Php – Configuration Issues with PECL and PHP-FPM

peclPHPphp-fpm

I'm using Ubuntu Natty. I recently installed NGINX 1.0.6 and PHP 5.3.8 (with –enable-fpm) from source. Everything went ok and I tested it with an info.php page with phpinfo().

I then installed APC and Memcache using PECL i.e. pecl install apc, etc. That seemed to go ok as well.

However, when I edit my php.ini file and add the extension_dir and extension modules for both APC and Memcache, I get the following when I restart PHP.

Starting php-fpm PHP Warning:  Module 'apc' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'apc' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'memcache' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'memcache' already loaded in <b>Unknown</b> on line <b>0</b><br />
 done

When I open the info.php file to check what loaded, everything seems ok i.e. I see APC and Memcache references in the information.

But when I uncomment the extensions i.e. ;extension=apc.so and ;extension=memcache.so, there are no errors, but the APC and Memcache listings in PHPinfo no longer appear.

I'm not sure how these extensions are being loaded, or if they are being loaded twice and from where. I'd appreciate some guidance.

Thanks in advance.

Best Answer

Do a quick search with:

# grep -lr memcache /path/to/the/extension_dir

for e.g:

# grep -lr memcache /etc/php.d/
/etc/php.d/memcache.ini