• 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 PHP extension for PHP support instruction error

pegasx

Basic Pleskian
Server operating system version
Centos 7.9
Plesk version and microupdate number
Plesk Obsidian v18.0.57
Hello,

I have tried to follow these instructions but ended with an error. ( https://support.plesk.com/hc/en-us/articles/12377651968023-How-to-install-uninstall-memcached-PHP-extension-for-Plesk-PHP-handlers )

These instruction will be failed if you want to change "igbinary => yes" on Centos 7.9. Could you please check it again?

Code:
/opt/plesk/php/7.4/bin/pecl install memcached
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
downloading memcached-3.2.0.tgz ...
Starting to download memcached-3.2.0.tgz (90,722 bytes)
.....................done: 90,722 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
libmemcached directory [no] :
zlib directory [no] :
use system fastlz [no] : yes
enable igbinary serializer [no] : yes
enable msgpack serializer [no] :
enable json serializer [no] : yes
enable server protocol [no] :
enable sasl [yes] :
enable sessions [yes] :
building in /tmp/pear-build-rootpvSZfO/memcached-3.2.0
running: /tmp/memcached/configure --with-php-config=/opt/plesk/php/7.4/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz --enable-memcached-igbinary=yes --enable-memcached-msgpack=no --enable-memcached-json=yes --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/plesk/php/7.4
checking for PHP includes... -I/opt/plesk/php/7.4/include/php -I/opt/plesk/php/7.4/include/php/main -I/opt/plesk/php/7.4/include/php/TSRM -I/opt/plesk/php/7.4/include/php/Zend -I/opt/plesk/php/7.4/include/php/ext -I/opt/plesk/php/7.4/include/php/ext/date/lib
checking for PHP extension directory... /opt/plesk/php/7.4/lib64/php/modules
checking for PHP installed headers prefix... /opt/plesk/php/7.4/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable memcached support... yes, shared
checking for libmemcached... yes, shared
checking whether to enable memcached session handler support... yes
checking whether to enable memcached igbinary serializer support... yes
checking whether to enable memcached json serializer support... yes
checking whether to enable memcached msgpack serializer support... no
checking whether to enable memcached sasl support... yes
checking whether to enable memcached protocol support... no
checking whether to use system FastLZ library... yes
checking for ZLIB... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for zlib location... /usr
checking for session includes... /opt/plesk/php/7.4/include/php
checking for json includes... /opt/plesk/php/7.4/include/php
checking for igbinary includes... configure: error: Cannot find igbinary.h
ERROR: `/tmp/memcached/configure --with-php-config=/opt/plesk/php/7.4/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz --enable-memcached-igbinary=yes --enable-memcached-msgpack=no --enable-memcached-json=yes --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes' failed
 
igbinary is an optional component. If it is not installed on your server and you try to use it, the installation of the PHP memcached extension will fail. That is an expected behavior. If you want to use igbinary, you first need to install it.
 
igbinary is an optional component. If it is not installed on your server and you try to use it, the installation of the PHP memcached extension will fail. That is an expected behavior. If you want to use igbinary, you first need to install it.

I guess igbinary is installed and I see this error.

Code:
#rpm -qa|grep igbinary
php-pecl-igbinary-1.2.1-1.el7.x86_64
 
By copying needed .h files I have managed to install php memcached extension. But it did not run properly so I have decided to uninstall from console and plesk, it gives the same error.

# /opt/plesk/php/7.4/bin/pecl uninstall memcached
PHP Fatal error: Uncaught Error: Cannot use object of type PEAR_Error as array in /opt/plesk/php/7.4/share/pear/PEAR/Dependency2.php:1036
Stack trace:
#0 /opt/plesk/php/7.4/share/pear/PEAR/Installer.php(1669): PEAR_Dependency2->validatePackageUninstall()
#1 /opt/plesk/php/7.4/share/pear/PEAR/Command/Install.php(997): PEAR_Installer->uninstall()
#2 /opt/plesk/php/7.4/share/pear/PEAR/Command/Common.php(270): PEAR_Command_Install->doUninstall()
#3 /opt/plesk/php/7.4/share/pear/pearcmd.php(310): PEAR_Command_Common->run()
#4 /opt/plesk/php/7.4/share/pear/peclcmd.php(32): require_once('/opt/plesk/php/...')
#5 {main}
thrown in /opt/plesk/php/7.4/share/pear/PEAR/Dependency2.php on line 1036
 

Attachments

  • Screenshot 2024-02-06 at 10-14-49 Settings for 7.4.33 Dedicated FPM application - Plesk Obsidi...png
    Screenshot 2024-02-06 at 10-14-49 Settings for 7.4.33 Dedicated FPM application - Plesk Obsidi...png
    45 KB · Views: 5
Please check again. The error message that you quote is incomplete. The most important line is missing:

1707206231069.png

As the extension has not been installed properly or partly removed before, the automatic removal fails, because expected files are missing.
 
I can not install or uninstall memcached extension.

# /opt/plesk/php/7.4/bin/pecl install memcached
pecl/memcached is already installed and is the same as the released version 3.2.0
install failed
 

Attachments

  • Screenshot 2024-02-06 at 11-02-02 Settings for 7.4.33 Dedicated FPM application - Plesk Obsidi...png
    Screenshot 2024-02-06 at 11-02-02 Settings for 7.4.33 Dedicated FPM application - Plesk Obsidi...png
    64.7 KB · Views: 4
You install igbinay in default php version and try use it in php 7.4

/opt/plesk/php/7.4/bin/pecl install igbinary
 
I have run this:

/opt/plesk/php/7.4/bin/pecl install igbinary

But still I can not install or uninstall memcached extension.

What do you suggest?

I can remove php 7.4 and dependicies (webmail apps), and install back. Will it be a problem? Or any basic solution?

Regards.
 
There is no issue with the installation of igbinary. You only need to adapt the path to it as described in the previously provided link:

There is also no issue with deinstallation when you have a correct installation. But in your case it seems you have a messed up installation with missing files, so deinstall won't work either.

I have alreasdy copied to .h files to correct place, but that did not work even install or uninstall.

[root@mail igbinary]# ls -l /opt/plesk/php/7.4/include/php/ext/igbinary
total 12
-rw-r--r-- 1 root root 261 Feb 6 09:24 igbinary.h
-rw-r--r-- 1 root root 788 Feb 6 09:24 php_igbinary.h
drwxr-xr-x 3 root root 4096 Feb 6 09:24 src
 
Reinstallion php7.4 did not work either.

[root@mail php]# ls -lh /opt/plesk/php/7.4/lib64/php/modules/igbinary.so
-rwxr-xr-x 1 root root 421K Feb 6 09:24 /opt/plesk/php/7.4/lib64/php/modules/igbinary.so
[root@mail php]# ls -l -h /usr/lib64/php/modules/igbinary.so
-rwxr-xr-x 1 root root 60K Aug 29 2014 /usr/lib64/php/modules/igbinary.so
 
Back
Top