Report this

What is the reason for this report?

How to configure FastCGI for HHVM on a LEMP server

Posted on June 15, 2014

I have been trying to get a LEMP server up and running with HHVM but after I install everything the install_fastcgi.sh always says:

root@Threed:~# sudo /usr/share/hhvm/install_fastcgi.sh Checking if Apache is installed WARNING: Couldn’t find Apache2 configuration paths, not configuring Checking if Nginx is installed Detected Nginx installation Checking for custom Nginx configuration WARNING: Detected clashing configuration. Look at /etc/nginx/hhvm.conf for information how to connect to the hhvm fastcgi instance.

and then it stops there. I have done this on Ubuntu 14.04 and Debian 7 (and the Ubuntu LEMP image) but it never gets past this part. hhvm --version gives me 3.1.0 and i can run php commands with it so its gotta just be something with the fastcgi. I’ve been looking up how to deal with this but havent found any info on this problem (especially not in /etc/nginx/hhvm.conf)

Was wondering if anyone could help me with this



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I had neither of those segments in my file to comment out. And upon adding the suggested lines I’m not seeing any difference. Any advice is appreciated. Thank you!

To enable HHVM on Nginx, you need to add the contents of <code>/etc/nginx/hhvm.conf</code> to your server block. By default, you’d run: <pre> sudo nano /etc/nginx/sites-enabled/default </pre> and add the following inside the server directive: <pre> location ~ .(hh|php)$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } </pre> If you already had FastCGI up and running with php5-fpm, you’ll need to remove or comment out its configuration. For instance, if you were using the LEMP one-click image, comment out the following: <pre>

location ~ .php$ {

try_files $uri =404;

fastcgi_split_path_info ^(.+.php)(/.+)$;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

</pre> Finally, remember to restart Nginx: <pre> sudo service nginx restart </pre>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.