• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved memcached

found this in the log

PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match

not sure how to resolve it
 


/opt/plesk/php/5.6/bin/pecl install memca ched
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/5.6/li b64/php/modules/memcache.so' - /opt/plesk/php/5.6/lib64/php/modules/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
pecl/memcached is already installed and is the same as the released version 2.2. 0
install failed
 
I think that you need to remove module file and the corresponding entry in php.ini file first.
 
Hi Madness,

first of all, pls. get rid of your first error:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/5.6/li b64/php/modules/memcache.so' - /opt/plesk/php/5.6/lib64/php/modules/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module

Command to use over the command line: /opt/plesk/php/5.6/bin/pecl uninstall memcache

... and don't forget to delete the depending *.ini - file, which automatically loads, when you placed it inside the folder "/opt/plesk/php/5.6/etc/php.d/"

Command to use over the command line: rm /opt/plesk/php/5.6/etc/php.d/memcache.ini

IMPORTANT:
If you placed the call of a module directly inside your "php.ini" , as for example with an entry like "extension=memcache.so" , pls. don't forget to delete such a manual entry from the "php.ini" !​



Second, to clean up your installation - mess, pls. consider to uninstall as well your previously ( unsuccessfully ) installed memcached - package:

Command to use over the command line: /opt/plesk/php/5.6/bin/pecl uninstall memcached

... and don't forget to delete the depending *.ini - file, which automatically loads, when you placed it inside the folder "/opt/plesk/php/5.6/etc/php.d/"

Command to use over the command line: rm /opt/plesk/php/5.6/etc/php.d/memcached.ini

IMPORTANT:
If you placed the call of a module directly inside your "php.ini" , as for example with an entry like "extension=memcached.so" , pls. don't forget to delete such a manual entry from the "php.ini" !​



Third, pls. keep an eye on your typing, because memcache and memcached are different packages. ;)



Fourth
, pls. be informed, that you don't necessarily have to compile an existent pecl - package manually, if the latest release might not suit your environment or needs. You are always able to DOWNGRADE an installed pecl - package with for example:

/opt/plesk/php/5.6/bin/pecl install memcached-2.2.0RC1
( With this command, a previously installed "memcached" - package will be DOWNGRADED to the version "2.20RC1". The version can be choosen with the additional string marked in RED )

If you are unsure, which PECL - extensions ( and different versions ) are available, pls. consider to visit: => https://pecl.php.net/package-search.php




Additional notes:
PECL
has as well additional install options, as for example the "-f" string, which forces an installation ( in case the requirements are not met, which are defined by the package maintainer ). Example: /opt/plesk/php/5.6/bin/pecl install -f memcached-2.2.0RC1

Another good idea is to use the install "-a" - string, which installs "all required and optional dependencies". Example: /opt/plesk/php/5.6/bin/pecl install -a memcached-2.2.0RC1
or

if you just desire to install only the "all required dependencies", you could use the install "-o" - string. Example: /opt/plesk/php/5.6/bin/pecl install -o memcached-2.2.0RC1


Pls. use the command "pecl help", or "pecl help COMMAND-NAME", to inform yourself about additional options, when you use PECL. Example: /opt/plesk/php/5.6/bin/pecl help install
 
Hi Madness,

first of all, pls. get rid of your first error:


Command to use over the command line: /opt/plesk/php/5.6/bin/pecl uninstall memcache

... and don't forget to delete the depending *.ini - file, which automatically loads, when you placed it inside the folder "/opt/plesk/php/5.6/etc/php.d/"

Command to use over the command line: rm /opt/plesk/php/5.6/etc/php.d/memcache.ini

IMPORTANT:
If you placed the call of a module directly inside your "php.ini" , as for example with an entry like "extension=memcache.so" , pls. don't forget to delete such a manual entry from the "php.ini" !​



Second, to clean up your installation - mess, pls. consider to uninstall as well your previously ( unsuccessfully ) installed memcached - package:

Command to use over the command line: /opt/plesk/php/5.6/bin/pecl uninstall memcached

... and don't forget to delete the depending *.ini - file, which automatically loads, when you placed it inside the folder "/opt/plesk/php/5.6/etc/php.d/"

Command to use over the command line: rm /opt/plesk/php/5.6/etc/php.d/memcached.ini

IMPORTANT:
If you placed the call of a module directly inside your "php.ini" , as for example with an entry like "extension=memcached.so" , pls. don't forget to delete such a manual entry from the "php.ini" !​



Third, pls. keep an eye on your typing, because memcache and memcached are different packages. ;)



Fourth
, pls. be informed, that you don't necessarily have to compile an existent pecl - package manually, if the latest release might not suit your environment or needs. You are always able to DOWNGRADE an installed pecl - package with for example:

/opt/plesk/php/5.6/bin/pecl install memcached-2.2.0RC1
( With this command, a previously installed "memcached" - package will be DOWNGRADED to the version "2.20RC1". The version can be choosen with the additional string marked in RED )

If you are unsure, which PECL - extensions ( and different versions ) are available, pls. consider to visit: => https://pecl.php.net/package-search.php




Additional notes:
PECL
has as well additional install options, as for example the "-f" string, which forces an installation ( in case the requirements are not met, which are defined by the package maintainer ). Example: /opt/plesk/php/5.6/bin/pecl install -f memcached-2.2.0RC1

Another good idea is to use the install "-a" - string, which installs "all required and optional dependencies". Example: /opt/plesk/php/5.6/bin/pecl install -a memcached-2.2.0RC1
or

if you just desire to install only the "all required dependencies", you could use the install "-o" - string. Example: /opt/plesk/php/5.6/bin/pecl install -o memcached-2.2.0RC1


Pls. use the command "pecl help", or "pecl help COMMAND-NAME", to inform yourself about additional options, when you use PECL. Example: /opt/plesk/php/5.6/bin/pecl help install

Thank you for replying. I have followed the steps and tried to install again and im getting this:

WARNING: php_bin /opt/plesk/php/5.6/bin appears to have a suffix /5.6/bin, but c onfig variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
libmemcached directory [no] : echo "extension=memcached.so" > /opt/plesk/php/5.6 /etc/php.d/memcached.ini
building in /tmp/pear-build-rootNTwHjg/memcached-2.2.0
running: /tmp/memcached/configure --with-libmemcached-dir=echo "extension=memcac hed.so" > /opt/plesk/php/5.6/etc/php.d/memcached.ini
ERROR: `/tmp/memcached/configure --with-libmemcached-dir=echo "extension=memcach ed.so" > /opt/plesk/php/5.6/etc/php.d/memcached.ini' failed
 
libmemcached directory [no] : echo "extension=memcached.so" > /opt/plesk/php/5.6 /etc/php.d/memcached.ini

???

Pls. READ => https://devblog.plesk.com/2015/08/adding-custom-php-modules-in-plesk/

...
(when prompted for the libmemcached directory, leave it blank and hit the Enter key)
...

This means: WHEN you see on your command line: libmemcached directory [no] :
... then just leave it as it is and hit/press your keyboard key Enter/Return ( or what ever your key is labeled with ). The process will continue and the process will finish as expected without any issues/failures/problems.

AFTERWARDS ( when the whole process of compilitation and installation is finished!!! ), pls. use the command:

echo "extension=memcached.so" > /opt/plesk/php/5.6 /etc/php.d/memcached.ini
... which will create a file called "memcached.ini" in your directory "/opt/plesk/php/5.6 /etc/php.d", with the content: "extension=memcached.so"



Pls. just follow such instructions, as from the Plesk Developer Blog , step by step... they are really easy to understand and to follow, just like all suggestions and resolutions from KB - articles at the Plesk knowledge base !!! ;)
 
???

Pls. READ => https://devblog.plesk.com/2015/08/adding-custom-php-modules-in-plesk/



This means: WHEN you see on your command line: libmemcached directory [no] :
... then just leave it as it is and hit/press your keyboard key Enter/Return ( or what ever your key is labeled with ). The process will continue and the process will finish as expected without any issues/failures/problems.

AFTERWARDS ( when the whole process of compilitation and installation is finished!!! ), pls. use the command:


... which will create a file called "memcached.ini" in your directory "/opt/plesk/php/5.6 /etc/php.d", with the content: "extension=memcached.so"



Pls. just follow such instructions, as from the Plesk Developer Blog , step by step... they are really easy to understand and to follow, just like all suggestions and resolutions from KB - articles at the Plesk knowledge base !!! ;)

Ive done everything you you said and i can see memcached in tools/php settings, but it still not showing in phpinfo.php
 
Hi Madness,

if you use PHP-FPM with the Plesk PHP - version X.X on your domain, where you tried to inspect the "phpinfo.php" at, did you as well RESTART the service, so that changes you made for the corresponding PHP - version are visible? :rolleyes:
 
Hi Madness,

if you use PHP-FPM with the Plesk PHP - version X.X on your domain, where you tried to inspect the "phpinfo.php" at, did you as well RESTART the service, so that changes you made for the corresponding PHP - version are visible? :rolleyes:
Ye I even restarted the server.
 
Hi Madness,

well, you now should see "memcached.ini" at the "Additional .ini files parsed" from your "phpinfo.php".

Additional settings are now done over your memcached server and it's configuration files ( for example: "/etc/sysconfig/memcached" ) , which you have to install with "yum install memcached" for CentOS 6.8 .

If you need further help "How to use memcached", pls. consider a Google search for example: => http://lmgtfy.com/?q="CentOS+6.8"+"memcached"
 
Hi Madness,

well, you now should see "memcached.ini" at the "Additional .ini files parsed" from your "phpinfo.php".

Additional settings are now done over your memcached server and it's configuration files ( for example: "/etc/sysconfig/memcached" ) , which you have to install with "yum install memcached" for CentOS 6.8 .

If you need further help "How to use memcached", pls. consider a Google search for example: => http://lmgtfy.com/?q="CentOS+6.8"+"memcached"

keep seeing this in error log for some reason
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0

Doesn't matter tho thank you very much for all you help guys :)
 
Hi Madness,

PHP Warning: PHP Startup: memcache: Unable to initialize module

... pls. note again the difference between "memcache" and "memcached" and pls. read again the suggestions, how to get rid of the "memcache" module : => #6
 
Last edited by a moderator:
Hi Madness,



... pls. note again the difference between "memcache" and "memcached" and pls. read again the suggestions, how to get rid of the "memcache" module : => #6

Yes i did that its not installed.

soon as i add memchached to plesk and its visible in php settings this error starts

/etc/httpd/logs/error_log

PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0

Again ive not installed anything more than has been advised above and i have uninstalled as instructed #6
 
Hi Madness,

you could consider to use a serverwide search, as for example with:

Code:
find / -type f -name "*.*" -exec grep --color -Hni "memcache.so"  {} \;
... to find out, where the module "memcache.so" is loaded from and where the binary file is located on your server.
 
Back
Top