sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install php5-dev libpcre3-dev gcc make php5-intl php5-mysql git-core autoconf
php -v
php-config --extension-dir
Make sure when installing cphalcon the extension is being built in the correct extension directory for your php version. If you upgrade php versions, the package must be recompiled and placed in the correct extension directory for php to find it.
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
echo 'extension=phalcon.so' | sudo tee -a /etc/php5/mods-available/phalcon.ini
cd /etc/php5/mods-available
sudo php5enmod phalcon
sudo service nginx restart
sudo service php5-fpm restart
php -m | grep phalcon