To enable HHVM on Nginx, you need to add the contents of
/etc/nginx/hhvm.conf
to your server block. By default, you'd run:
sudo nano /etc/nginx/sites-enabled/default
and add the following inside the server directive:
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;
}
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:
# 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;
# }
Finally, remember to restart Nginx:
sudo service nginx restart