Source: youtube.com

APC — the Alternative PHP Cache — is a handy caching utility for use with PHP. We use it with W3 Total Cache to speed up our WordPress sites.

I recently had a little trouble remembering how to upgrade APC to a more current version on our Ubuntu installations. We had installed APC with pecl, so here is how I (eventually) upgraded APC:

$ sudo pecl install -f apc

The trick was the -f flag, which tells pecl to force overwriting of newer installed packages.

Once pecl finished, I had to restart Apache:

$ sudo /etc/init.d/apache2 graceful

Super easy — in hindsight!


UPDATE: The latest upgrade failed on me a few times.

First, I got error “sh: phpize: not found.” I fixed that with:

$ sudo apt-get install php5-dev

Then I got error “pcre.h: No such file or directory.” That was fixed with:

$ sudo apt-get install libpcre3-dev

One more try, and I successfully upgraded to APC 3.1.13.