Categories
Linux PHP

Install APCu on serverpilot for PHP 5.6

UPDATE 29-11-2015: Works great and now they have official docs to do this procedure including PHP7, see it here.

I am testing ServerPilot.io and so far love it, soon I will speak about it, though I find some stuff a bit difficult since I am not a sys admin.

We need APC to store key=>values in our application, not for opcode.

For that we can use APCu, full compatible API with APC and without opcode.

sudo apt-get install gcc make autoconf
sudo pecl5.6-sp install channel://pecl.php.net/apcu-4.0.7 #or latest see APCu site
sudo bash -c "echo extension=apcu.so > /etc/php5.6-sp/conf.d/apcu.ini"
sudo service php5.6-fpm-sp restart

Took me a while but works like charm. Should also work with PHP 5.5 by replacing the version number.

They have documented how to do it for PHP 5.4, would be nice to update it.
https://serverpilot.io/community/articles/how-to-install-php-apc-extension.html

Normally in Ubuntu will work just by doing a simple:

sudo apt-get install php-apc