This how-to will help you with your installation and configuration of HHVM on your CentOS 6 server. For those of you who didn’t know, HipHop Virtual Machine (HHVM) is a virtual machine developed and open-sourced by Facebook to process and execute programs and scripts written in PHP. Facebook developed HHVM because the regular Zend+Apache combination isn’t as efficient to serve large applications built in PHP.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you the step-by-step installation of HHVM on CentOS 6.
Prerequisites
- A server running one of the following operating systems: CentOS 6.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install HHVM on CentOS 6
Step 1. First, you need to enable the EPEL repository on your system.
## RHEL/CentOS 6 64-Bit ## wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
Step 2. Install HHVM.
Now we can install HHVM with the following command:
cd /etc/yum.repos.d wget http://www.hop5.in/yum/el6/hop5.repo yum clean all yum install hhvm
HHVM should have been successfully installed, to make sure to run the following command:
hhvm --version
Finally, run the commands below to start up HHVM:
service hhvm start
If you are upgrading from the previous hip-hop-PHP Package, Run the following command:
yum update hiphop-php
Step 3. Testing HHVM.
To test HHVM, create a test page in the root directory and type these lines in the file and save it:
nano /var/www/html/hhvminfo.php
Then add the following code to your new file:
<? php phpinfo(); ?>
Try to access it at http://your_server_ip/hhvminfo.php
. If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.
Congratulations! You have successfully installed HHVM. Thanks for using this tutorial for installing HHVM (HipHop Virtual Machine) in CentOS 6 system. For additional help or useful information, we recommend you check the official HHVM website.