PHP/HHVM

From Bibliotheca Anonoma
Revision as of 22:38, 4 April 2017 by Antonizoon (talk | contribs)

First, install HHVM:

https://www.digitalocean.com/community/tutorials/how-to-install-hhvm-with-nginx-on-ubuntu-14-04

https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/

For better performance, set up HHVM as a UNIX socket to reduce additional load from TCP layers.

https://docs.hhvm.com/hhvm/advanced-usage/fastCGI#using-fastcgi

Add

/etc/hhvm/server.ini
hhvm.server.file_socket=/var/run/hhvm/sock

Systemd Service

Make sure you've installed Nginx from the official nginx repos, rather than your distribution's outdated versions. On both Debian and CentOS, this will result in the creation of an nginx user and group, which is then made accessible in the systemd service below:

/etc/systemd/system/hhvm.service
[Unit]
Description=HHVM HipHop Virtual Machine (FCGI)
After=network.target nginx.service mariadb.service
 
[Service]
User=nginx
Group=nginx
ExecStart=/usr/local/bin/hhvm --config /etc/hhvm/server.ini --user nginx --mode daemon -vServer.Type=fastcgi -vServer.FileSocket=/var/run/hhvm/hhvm.sock
 
[Install]
WantedBy=multi-user.target