• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Problems with installing memcached for PHP 8.0

Martin73

Basic Pleskian
I used the following instructions for installing memcached and changed 7.4 to 8.0:

Code:
apt install memcached autoconf automake gcc libmemcached-dev libhashkit-dev pkg-config plesk-php*-dev zlib1g-dev
/opt/plesk/php/8.0/bin/pecl install memcached
echo "extension=memcached.so" > /opt/plesk/php/8.0/etc/php.d/memcached.ini
plesk bin php_handler --reread
service plesk-php80-fpm restart
service apache2 restart
/opt/plesk/php/8.0/bin/php -m | grep memcached

But after the last step I get the following error message:
Code:
PHP Warning:  PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /opt/plesk/php/8.0/lib/php/modules/memcached.so (/opt/plesk/php/8.0/lib/php/modules/memcached.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.0/lib/php/modules/memcached.so.so (/opt/plesk/php/8.0/lib/php/modules/memcached.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Does anyone have an idea for the reason. The file memcached.so doesn't exist on my server, but how can I initialize it?

OS: Ubuntu 20.04.3 LTS
Plesk: Obsidian 18.0.40
 
You are right, there is an error. What can I do? :confused:
PHP Warning: PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /opt/plesk/php/8.0/lib/php/modules/memcached.so (/opt/plesk/php/8.0/lib/php/mod ules/memcached.so: cannot open shared object file: No such file or directory), / opt/plesk/php/8.0/lib/php/modules/memcached.so.so (/opt/plesk/php/8.0/lib/php/mo dules/memcached.so.so: cannot open shared object file: No such file or directory )) in Unknown on line 0
pecl/memcached is already installed and is the same as the released version 3.1. 5
install failed
 
After step
Code:
/opt/plesk/php/8.0/bin/pecl install memcached
PHP memcached module compilation process should be completed without any errors. There is no point in taking subsequent steps without successfully completing this step. I asked about errors in this step.

I suppose that you have error like
Code:
ERROR: `phpize' failed
In this case, you have to install additional package:
Code:
# apt install plesk-php80-dev
Or do you have another error on this step of module compilation?
 
It's already installed. This is the message:
Code:
# apt install plesk-php80-dev
plesk-php80-dev is already the newest version (8.0.13-ubuntu.20.04.211119.1249).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
# /opt/plesk/php/8.0/bin/pecl install memcached
pecl/memcached is already installed and is the same as the released version 3.1.5
There is no other error. Memcached for PHP 7.4 is working fine. I don't understand the problems for PHP 8.0.
 
It's already installed. This is the message:
Code:
# apt install plesk-php80-dev
plesk-php80-dev is already the newest version (8.0.13-ubuntu.20.04.211119.1249).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
# /opt/plesk/php/8.0/bin/pecl install memcached
pecl/memcached is already installed and is the same as the released version 3.1.5
There is no other error. Memcached for PHP 7.4 is working fine. I don't understand the problems for PHP 8.0.
Do you have this module loaded now? Please check it with

# /opt/plesk/php/8.0/bin/php -m | grep memc
 
This is the result:
Code:
# /opt/plesk/php/8.0/bin/php -m | grep memc
PHP Warning:  PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /opt/plesk/php/8.0/lib/php/modules/memcached.so (/opt/plesk/php/8.0/lib/php/modules/memcached.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.0/lib/php/modules/memcached.so.so (/opt/plesk/php/8.0/lib/php/modules/memcached.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
 
Please, make sure that command:

Code:
# /opt/plesk/php/8.0/bin/pecl install memcache

is completed with the following message:

Code:
Build process completed successfully
Installing '/opt/plesk/php/8.0/lib64/php/modules/memcached.so'
install ok: channel://pecl.php.net/memcached-3.1.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=memcached.so" to php.ini

As you can see, compiled module should be located in /opt/plesk/php/8.0/lib64/php/modules/memcached.so but not in /opt/plesk/php/8.0/lib/php/modules/memcached.so
 
That was a difficult birth. I uninstalled memcached and started from scratch. The php.ini was the cause. Here are the steps for the installation:
Code:
apt install memcached autoconf automake gcc libmemcached-dev libhashkit-dev pkg-config plesk-php*-dev zlib1g-dev
/opt/plesk/php/8.0/bin/pecl install memcached
add "extension=memcached.so" to php.ini
Following:
Code:
echo "extension=memcached.so" > /opt/plesk/php/8.0/etc/php.d/memcached.ini
plesk bin php_handler --reread
service plesk-php80-fpm restart
service apache2 restart
/opt/plesk/php/8.0/bin/php -m | grep memcached
The compiled module is located in /opt/plesk/php/8.0/lib/php/modules/memcached.so. There is no lib64 folder.
Many thanks for your help!!!
 
Not sure any of this applies, but I see the extension installed in my PHP info.

/opt/plesk/php/8.0/etc/php.d/mbstring.ini, /opt/plesk/php/8.0/etc/php.d/memcached.ini,

But I don't see a configuration listing for it on that info page.

????
 
Back
Top