Note: HHVM doesn’t play with all WordPress themes and plugins. Test your site properly before using this in production.
For installation of HHVM please follow this guide:
https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM
We need to configure our web server to use HHVM,
sudo /usr/share/hhvm/install_fastcgi.sh
You can ignore the WARNING from following message.
# 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.
#
Open server.ini file:
vim /etc/hhvm/server.ini
If HHVM crashed then site must use PHP-FPM as fallback, so change HHVM server port from 9000 to 8000
hhvm.server.port = 8000
Open php.ini file:
vim /etc/hhvm/php.ini
Add following towards end of file:
hhvm.log.header = true
hhvm.log.natives_stack_trace = true
Note: This editing is not required, as we are not using this file, but if have included hhvm.conf in your previous site then you also need to change HHVM port here.
vim /etc/nginx/hhvm.conf
and change HHVM port from 9000 to 8000:
fastcgi_pass 127.0.0.1:8000;
Open fastcgi.conf file:
vim /etc/nginx/conf.d/fastcgi.conf
and add following line towards end of file:
fastcgi_keep_conn on;
Open Upstream.conf file:
vim /etc/nginx/conf.d/upstream.conf
and make sure it look like this:
# Common upstream settings
upstream php {
# server unix:/run/php5-fpm.sock;
server 127.0.0.1:8000;
server 127.0.0.1:9000 backup;
}
upstream debug {
# Debug Pool
server 127.0.0.1:9001;
}
service hhvm restart
php5-fpm -t && service php5-fpm restart
nginx -t && service nginx restart
HipHop
then, your server is using HHVM, otherwise it is using FPM
curl -I example.com
If you are able to see line like this:
X-Powered-By: HHVM/3.2.0
then your site is using HHVM, otherwise FPM
You should check the HHVM error log file for any issues related to your site.
tail -f /var/log/hhvm/error.log