Search code examples
phpapc

Loading extension apc for php5.4.6


I'm afraid I put quite a mess on my development computer and I could use some help. Basically, I had php5.3.2 on ubuntu installed with apt-get package with apc loaded as a dynamic extension.

Today, I decided to upgrade to php5.4.6 using this PPA: https://launchpad.net/~ondrej/+archive/php5. So, I run now php5.4.6 but apc won't load anymore.

So I did

pecl uninstall apc 

then

pecl install apc-3.1.13

to make sure I got a version of apc compatible with php5.4.

Everythin seems to go well but the extension still won't load. It does not show on a phpinfo(). I added extension=apc.so in php.ini of course.

I think I found the origin of the problem but I don't know how to fix it:

According to my phpinfo():

PHP API                 20100412
PHP Extension           20100525
Zend Extension          220100525
Zend Extension Build    API220100525,NTS
PHP Extension Build     API20100525,NTS 

When I do, pecl install apc, I got:

54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

As a result apc.so will be installed in /usr/lib/php5/20090626 instead of /usr/lib/php5/20100525.

How can I fix this?


Solution

  • I found a way to fix that. A simple

    sudo apt-get install php-apc
    

    will do the trick.