Upgrading PHP APCu on Ubuntu 14.04 LTS

Ubuntu 14.04 LTS ships with an outdated version of the PHP user cache driver ‘APCu’. OwnCloud, if installed, will complain about this. Here I describe how to upgrade APCu on Ubuntu.

daniel@ubuntu:~$ sudo apt-get install php5-dev

daniel@ubuntu:~$ sudo pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

daniel@ubuntu:~$ sudo pecl install apcu
downloading apcu-4.0.7.tgz ...
Starting to download apcu-4.0.7.tgz (118,670 bytes)
..........................done: 118,670 bytes
43 source files, building
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
Enable full APC compatibility [yes] : 
Enable internal debugging in APCu [no] : 
building in /tmp/pear/temp/pear-build-roottN0cQ5/apcu-4.0.7

...

configuration option "php_ini" is not set to php.ini location
You should add "extension=apcu.so" to php.ini

daniel@ubuntu:~$ 

No need to worry about that last complaint about extension=apcu.so missing; it is defined in /etc/php5/apache2/conf.d/20-apcu.ini by default.

Don’t forget to restart Apache!