PHP remove/fix module not found or already loaded warnings?

mahen3d picture mahen3d · Oct 29, 2013 · Viewed 51.4k times · Source

When i run a php script from the command line like below

php test.php

i get following output

PHP Warning:  Module 'memcache' already loaded in Unknown on line 0
PHP Warning:  Module 'apc' already loaded in Unknown on line 0

how do i fix or remove these module warnings ? I checked the php.ini in

etc/php.ini 

output of

php -i | grep php.ini
PHP Warning:  Module 'memcache' already loaded in Unknown on line 0
PHP Warning:  Module 'apc' already loaded in Unknown on line 0
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

i dont see any loading or any reference to these two modules in there ...

please help

Answer

Jenson M John picture Jenson M John · Oct 29, 2013

When you install php5-memcache it adds it's own memcache.ini file which is set to load that extension already. So Just remove/comment the loading of the extension from your php.ini.

 ;extension=memcache.so

Similar with APC (Alternative PHP Cache Module).

 ;extension=apc.so