Editing PHP/HHVM

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
The PHP engine runs the MediaWiki source code. However, rather than using the conventional PHP engine, this configuration will use Facebook’s HHVM for significantly higher performance. Follow these instructions to set up the HHVM package:
First, install HHVM:


* '''Debian/Ubuntu''': https://docs.hhvm.com/hhvm/installation/linux
https://www.digitalocean.com/community/tutorials/how-to-install-hhvm-with-nginx-on-ubuntu-14-04
* '''RHEL/CentOS''': https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Centos-7.x


{{Note|Make sure you've installed [[Nginx/MediaWiki|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 will be necessary as shown below.}}
https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/


{{Note|According to the build instructions, HHVM only compiles and runs on 64-bit CPUs only.}}
For better performance, set up HHVM as a UNIX socket to reduce additional load from TCP layers.


First, edit the HHVM configuration file, and in line 7, replace the server port line with the following to activate the UNIX socket:
https://docs.hhvm.com/hhvm/advanced-usage/fastCGI#using-fastcgi
 
{{hc|/etc/hhvm/server.ini|<nowiki>
;hhvm.server.port = 9000
hhvm.server.user = nginx
hhvm.server.file_socket = /var/run/hhvm/hhvm.sock
</nowiki>}}


== Systemd Service ==
== Systemd Service ==


Then, create a customized Systemd configuration file for HHVM, which will provide Nginx with the ability to read and write to the UNIX socket:
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:


{{hc|/etc/systemd/system/hhvm.service|<nowiki>
{{hc|/etc/systemd/system/hhvm.service|<nowiki>
Line 33: Line 26:
WantedBy=multi-user.target
WantedBy=multi-user.target
</nowiki>}}
</nowiki>}}
Now, reload the systemd services. You only need to do this whenever you edit the systemd service files.
sudo systemctl daemon-reload
Finally, start HHVM.
sudo systemctl start hhvm
If it works out, enable the hhvm service.
sudo systemctl enable hhvm
== Sources ==
* [https://docs.hhvm.com/hhvm/advanced-usage/fastCGI#using-fastcgi FastCGI UNIX Socket]
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Templates used on this page: