How to Install HHVM and Nginx on a Linux VPS

What is HHVM?

HHVM is an engine that can be used to run program code written in the PHP language . In essence, HHVM serves as an "engine" that can execute PHP code faster than if the code is run using a regular PHP interpreter..

HHVM compiles PHP code into bytecode which is then run in its virtual machine, resulting in a faster execution process.

HHVM also provides some additional features such as support for asynchronous processing and the Hack programming language. So, in short, HHVM is an engine that can help run PHP code more quickly and efficiently.

What is Nginx?

Nginx is a popular and widely used web server for managing web traffic. Its features include web server, reverse proxy, load balancer, and HTTP cache.

The developer of Nginx was Igor Sysoev in 2002 and became publicly known in 2004. At the beginning of its launch, the software immediately caught the attention of web developers and even many of the Apache users also began to switch to Nginx.

How to Install HHVM and Nginx on a Linux VPS

Okay, now that you know what HHVM and Nginx are. Now we have entered a technical discussion on how to install HHVM and Nginx on a Linux VPS.

Follow the steps below on how to install HHVM and Nginx on a Linux VPS:

Install HHVM on Linux VPS

Step 1: Install the required packages with the command below:

sudo apt-get install software-properties-common

Step 2: Add PPA for HHVM with the following command,

sudo apt-add-repository ppa:mapnik/boost

Step 3: Update package index with the command below:

sudo apt-get update

Langkah 4: Install HHVM with the command below: 

sudo apt-get install hhvm

After the installation process is complete, run the hhvm -version command to make sure HHVM has been installed correctly.

Install Nginx di Linux VPS

Step 1: Install Nginx by entering the command below:

sudo apt-get install nginx

After the installation is complete, run the nginx -v command to make sure Nginx is installed correctly.

Step 2: Configure Nginx by editing the configuration file in /etc/nginx/sites-available/default. Then change the root section to the root directory of your application and add the line fastcgi_pass 127.0.0.1:9000; under the location ~\.php$ {.

Step 3: Run the sudo service nginx restart command to apply the configuration changes. The trick is to enter the code below:

service nginx restart

To finish, make sure that Nginx and HHVM are installed properly. You can do this by opening your VPS IP address in a web browser.

If you encounter any difficulties, contact our technical support who are ready to help you anytime.

Conclusion

That's the discussion about HHVM and Nginx, in a nutshell in terms of advantages and disadvantages. HHVM does provide the convenience of compiling PHP programming faster, but it requires more memory than a regular PHP interpreter to run the same code.

While Nginx is much more suitable for Linux users, other operating systems such as Microsoft Windows may still be able to run Nginx, it's just that it is less optimal in running.

The bottom line is, you can use Nginx and HHVM if you're okay with some of the drawbacks and they don't affect your website's performance. On the other hand, if the drawbacks are significant, we recommend not using both.

If you are still confused about how to make the best choice between using it or not, our technical support is ready to help. Please feel free to ask us about your concerns and needs.

Good Luck

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.