Faster with HHVM and nginx

This tutorial is not for beginners and aims to help you to remember what are the major steps to install Jorani with nginx web server and Facebook Hip Hop virtual machine. Some steps such as installing the database or the software itself are omitted. In addition, I would suggest you to read the tutorial of installation with Apache.

We will explain how to install on Ubuntu 14.10. Please note that HHVM only works with 64-bit machines.


HHVM comes in the form of source code or as pre-built packages. We will use the packages for Ubuntu 14.10.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository 'deb http://dl.hhvm.com/ubuntu utopic main'
sudo apt-get update
sudo apt-get install hhvm

Configure HHVM

The page "report of the presence of an employee" uses cal_days_in_month PHP function that does not yet exist (at the time of this writing) in HHVM API. So we need to enable the Zend compatibility layer (in /etc/hhvm/php.ini) :

hhvm.enable_zend_compat = true

Start HHVM as FastCGI

HHVM executes PHP scripts and dialogues with your web server via FastCGI in a rather similar way to PHP-FPM. In this example, we will launch it so that it communicates with the web server via the network (it is also possible to use a socket if both servers are on the same machine).

hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9010

If you encounter errors (segmentation fault, libgmp.so.10, libmemcachedutil.so.2), please read the documentation of HHVM project because many solutions are provided.

If you want to use Apache, you can find more information in the HHVM project documentation.

Configure nginx

A sample configuration is provided in the Jorani Github repository, but you need to adjust it according to your environment. For example, I change the line:




Since I launched HHVM on this network port.

Do not forget to configure your system so that nginx has the right permissions on the directory where you've installed Jorani.

Of course, you need to install and configure properly Jorani.

Tags :    tutorial   configure 

You may also like

What version of PHP is recommended for Jorani?

We realised a benchmark of the different PHP versions (5.3 up to PHPng and HHVM) so as to recommend a runtime.   Read »

Activating Google analytics js tracking code

This article explains how to activate the Google analytics tracking code and to optionally trace the user ID.   Read »

Translate Jorani into our own language

Even if don't have any technical background, you can help us (and you :) by translating Jorani in your language. No tools or experience is needed.   Read »

Modifying a submitted leave request

HR officer and manager can edit any leave request. This is useful if an employee made a mistake on a submitted leave request.   Read »

How to modify and create leave types?

HR officer and manager can manage the list of leave types. They can create, modify or delete any leave type except the compensate leave type.   Read »

comments powered by Disqus