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

Operating System & Version
Centos 7
cPanel & WHM Version
92.0.6

amelen

Active Member
Sep 15, 2003
36
0
156
Started getting this error recently:

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

Here is where memcache is being referenced. What could be the issue?

[[email protected] ~]# grep memcache -R /opt/cpanel/ea-php72/root/etc
/opt/cpanel/ea-php72/root/etc/php.d/zzzzzzz-pecl.ini:extension="memcached.so"
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:extension=memcache.so
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:; PHP: Runtime Configuration - Manual
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:; use memcache to store PHP sessions
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:; session.save_handler = "memcache"
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:; memcache.default_port = 11211
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:extension=memcached.so
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:; PHP: Runtime Configuration - Manual
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:; use memcache to store PHP sessions
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:; session.save_handler = "memcache"
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:; memcache.default_port = 11211


[[email protected] ~]# grep memcached -R /opt/cpanel/ea-php72/root/etc
/opt/cpanel/ea-php72/root/etc/php.d/zzzzzzz-pecl.ini:extension="memcached.so"
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:extension=memcached.so
 
Last edited by a moderator:

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
564
259
138
IN
cPanel Access Level
Root Administrator
You should check files

Code:
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini
and probably disable/remove one of them - or put comments (the # sign) at the beginning of the lines to disable.
 

amelen

Active Member
Sep 15, 2003
36
0
156
You should check files

Code:
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini
and probably disable/remove one of them - or put comments (the # sign) at the beginning of the lines to disable.
I installed it a while back following cpanel's guidance - they never mentioned anything about commenting something out. Do you know if there is any further guidance on which one I should be commenting out?
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
564
259
138
IN
cPanel Access Level
Root Administrator
See below lines, both are trying for the same port is conflicting and throwing error. So just disable ( comment with # sign ) either memcache or memcached and you should be okay.

Code:
/opt/cpanel/ea-php72/root/etc/php.d/memcache.ini:; memcache.default_port = 11211
/opt/cpanel/ea-php72/root/etc/php.d/memcached.ini:; memcache.default_port = 11211
 

amelen

Active Member
Sep 15, 2003
36
0
156
Contents of those two files are below btw. Which one should I disable? i was under the assumption that to use memcache you need both of them?


; Enable yaml extension module
extension=memcached.so



; Enable yaml extension module
extension=memcache.so
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
564
259
138
IN
cPanel Access Level
Root Administrator
Try commenting:

Code:
extension=memcached.so
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
564
259
138
IN
cPanel Access Level
Root Administrator
You're most welcome :)
 
  • Like
Reactions: cPRex