Since the Phalcon module is not provided in its latest version for many Ubuntu distributions we need to compile our own from latest stable Git repository.
In our case the server has installed PHP5.6 and PHP7.1 versions as CLI as well as FPM modules.
To find out which extension dir is the default PHP using, exec:
php -i | grep extension_dir
or specifically for PHP5.6:
php5.6 -i | grep extension
Install PHP sources:
aptitude install php5.6-dev
Checkout latest stable Phalcon release from Git:
git clone https://github.com/phalcon/cphalcon
Build the module:
cd cphalcon/build sudo ./install
Enable Phalcon module for PHP. In case of FPM do:
cd /etc/php/5.6/fpm/conf.d ln -s /etc/php/5.6/mods-available/phalcon.ini 20-phalcon.ini
Restart the FPM server:
service php5.6-fpm restart
Check the phpinfo page at your host:
You should see the most current version of Phalcon loaded.
If you are installing for PHP 7.1 just replace 5.6 with 7.1 in the above commands.