• 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

Issue Activating memcached.so on PHP 7.1 help please :)

javismiles

Basic Pleskian
Good day friends :)
Centos 7.5, Plesk Onyx, I have memcache.so extension installed for a php 5.4 website, but now I needed to also install the other memcached.so extension for a php 7.1 website, so I went to this great article:
How to install/uninstall memcached or memcache extension for PHP on Plesk server?

and installed it.
I can now see that doing
find / -name "memcac*.so"

that I have both:

/opt/plesk/php/7.1/lib64/php/modules/memcached.so
/usr/lib64/php/modules/memcache.so

so the installation worked well

I Can also see that inside this folder
/opt/plesk/php/7.1/etc/php.d

there is a memcached.ini file which inside has:
extension=memcached.so

This is all perfect. The problem comes now:

After restarting apache with
systemctl restart httpd
and of course doing all the other commands that the article says

I run phpinfo() and for some reason where it says "Additional .ini files parsed", plesk is not reading that memcached.ini file that is right there in between the other ones that yes it is reading! :) very odd,

so memcached is not appearing in phpinfo() because i think its not reading that memcached.ini file but i dont understand it because php info clearly says:
Scan this dir for additional .ini files: /opt/plesk/php/7.1/etc/php.d

and inside that folder is that memcached.ini which is not reading! :)

help please, thank you :)
 
extra weird thing, in plesk panel I go now to:
Tools and settings -> php settings -> Settings for 7.1.18 FPM application,
and there both memcached and memcache appear and marked/selected

but still phpinfo shows that php is not reading the memcached.ini file and not activating the extension, not sure why
 
I hope that you use phpinfo() on the domain, where PHP7.1 is used?
 
some parts of the output of phpinfo

PHP logo
PHP Version 7.1.18

Loaded Configuration File: /opt/plesk/php/7.1/etc/php.ini

Additional .ini files parsed

/opt/plesk/php/7.1/etc/php.d/00-ioncube-loader.ini, /opt/plesk/php/7.1/etc/php.d/10-opcache.ini, /opt/plesk/php/7.1/etc/php.d/20-mysqlnd.ini, /opt/plesk/php/7.1/etc/php.d/50-xdebug.ini, /opt/plesk/php/7.1/etc/php.d/bcmath.ini, /opt/plesk/php/7.1/etc/php.d/curl.ini, /opt/plesk/php/7.1/etc/php.d/dba.ini, /opt/plesk/php/7.1/etc/php.d/dom.ini, /opt/plesk/php/7.1/etc/php.d/enchant.ini, /opt/plesk/php/7.1/etc/php.d/fileinfo.ini, /opt/plesk/php/7.1/etc/php.d/gd.ini, /opt/plesk/php/7.1/etc/php.d/imagick.ini, /opt/plesk/php/7.1/etc/php.d/imap.ini, /opt/plesk/php/7.1/etc/php.d/intl.ini, /opt/plesk/php/7.1/etc/php.d/json.ini, /opt/plesk/php/7.1/etc/php.d/ldap.ini, /opt/plesk/php/7.1/etc/php.d/mbstring.ini, /opt/plesk/php/7.1/etc/php.d/mcrypt.ini, /opt/plesk/php/7.1/etc/php.d/mysqli.ini, /opt/plesk/php/7.1/etc/php.d/odbc.ini, /opt/plesk/php/7.1/etc/php.d/pdo.ini, /opt/plesk/php/7.1/etc/php.d/pdo_mysql.ini, /opt/plesk/php/7.1/etc/php.d/pdo_odbc.ini, /opt/plesk/php/7.1/etc/php.d/pdo_pgsql.ini, /opt/plesk/php/7.1/etc/php.d/pdo_sqlite.ini, /opt/plesk/php/7.1/etc/php.d/pgsql.ini, /opt/plesk/php/7.1/etc/php.d/phar.ini, /opt/plesk/php/7.1/etc/php.d/posix.ini, /opt/plesk/php/7.1/etc/php.d/pspell.ini, /opt/plesk/php/7.1/etc/php.d/redis.ini, /opt/plesk/php/7.1/etc/php.d/snmp.ini, /opt/plesk/php/7.1/etc/php.d/soap.ini, /opt/plesk/php/7.1/etc/php.d/sqlite3.ini, /opt/plesk/php/7.1/etc/php.d/sysvmsg.ini, /opt/plesk/php/7.1/etc/php.d/sysvsem.ini, /opt/plesk/php/7.1/etc/php.d/sysvshm.ini, /opt/plesk/php/7.1/etc/php.d/tidy.ini, /opt/plesk/php/7.1/etc/php.d/xmlreader.ini, /opt/plesk/php/7.1/etc/php.d/xmlrpc.ini, /opt/plesk/php/7.1/etc/php.d/xmlwriter.ini, /opt/plesk/php/7.1/etc/php.d/xsl.ini, /opt/plesk/php/7.1/etc/php.d/zip.ini


what is insane is that in that very same folder there is a memcached.ini file that is not being parsed
 
literally it should appear between these two
/opt/plesk/php/7.1/etc/php.d/mbstring.ini,
/opt/plesk/php/7.1/etc/php.d/mcrypt.ini,

doing an ls -l in that folder shows memcached.ini right in between those 2 files
 
actually between the next 2:

-rw-r--r-- 1 root root 57 May 28 01:13 mbstring.ini
-rw-r--r-- 1 root root 53 May 28 01:13 mcrypt.ini
-rw-r--r-- 1 root root 23 Jun 7 05:49 memcached.ini
-rw-r--r-- 1 root root 53 May 28 01:13 mysqli.ini
 
you can even see the date there, June 7 as that has been added right today

-rw-r--r-- 1 root root 57 May 28 01:13 mbstring.ini
-rw-r--r-- 1 root root 53 May 28 01:13 mcrypt.ini
-rw-r--r-- 1 root root 23 Jun 7 05:49 memcached.ini
-rw-r--r-- 1 root root 53 May 28 01:13 mysqli.ini

inside that file there is:
extension=memcached.so
 
Have you run

# plesk bin php_handler --reread

After that check output of

/opt/plesk/php/7.1/bin/php -m | grep memca
 
Thank you IgorG, I ran the commands of that article, what do those ones that you write do?
I will try them now thank you :)
 
oh oh, I did that and this is the result, mmm:

# plesk bin php_handler --reread
The information about PHP handlers was successfully updated.
# /opt/plesk/php/7.1/bin/php -m | grep memca
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20160303
These options need to match
in Unknown on line 0
memcached


weird, what could be wrong, I followed the instructions of the plesk article
 
oh this is the problem!
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20160303

a different in module API, what does that mean?, my PHP is 7.1.18, and the memcached I got was for version 7.1
 
In plesk onyx i can choose between 7.0.30 or 7.1.18,
I dont get whats the problem with this module API difference mmm, any ideas?
 
I just checked the logs of the installation, see


downloading memcached-3.0.4.tgz ...
Starting to download memcached-3.0.4.tgz (78,776 bytes)
..................done: 78,776 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
libmemcached directory [no] :
building in /tmp/pear-build-root4PIWk1/memcached-3.0.4


thats crazy because it installed 3.04 , which the website of the extension says that should work with php 7.0 and above,
so then?
 
even more weird, it says
Configuring for:
PHP Api Version: 20160303

which is correct, so then why is the Module compiled with API 20100525

Module compiled with module API=20100525
PHP compiled with module API=20160303
 
Back
Top