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 />

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.


Do a quick search with:

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

for e.g:

# grep -lr memcache /etc/php.d/
  • When I do that, I get only one result /usr/lib/php5/20090626/memcache.so. There's not /etc/php.d directory. Not sure what all this means though?!
    – Obi Hill
    Nov 16 '11 at 14:38
  • What extension_dir did you set in php.ini? This code find all the files contains memcache in its content.
    – quanta
    Nov 16 '11 at 15:31
  • I have the following in my php.ini file: extension_dir=/usr/lib/php5/20090626
    – Obi Hill
    Nov 16 '11 at 15:43
  • I'm using PHP-FPM and using lsof -i -P it appears that I have multiple pools of PHP-FPM running. Could this be part of the problem why I am seeing this error?! Is there a way to fix this?!
    – Obi Hill
    Nov 16 '11 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.