• 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 Memcache and memcached on Plesk Onyx

Jack_C

New Pleskian
Hello, I am a fairly beginner and need help with step by step instruction on how can I install Memcache and Memcached on my server and PHP 7.1.1.

Have desperately searched the forum and googled around, but can not find the right answer

Thanks to all who respond and help

OS:‪Debian 7.11‬
Product Plesk Onyx Version 17.0.17 Update #16, last updated on Feb 15, 2017
 
Hi Igor, yes I have problem. So I need more help about this problem, and step by step instruction
 
root@xxxxxxx:~# apt-get install make plesk-php71-dev gcc libmemcached-dev git pkg-config zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
git is already the newest version.
libmemcached-dev is already the newest version.
make is already the newest version.
pkg-config is already the newest version.
zlib1g-dev is already the newest version.
plesk-php71-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
 
Start module compilation now with

# /opt/plesk/php/7.1/bin/pecl install memcached

Then install module with

# echo "extension=memcached.so" > /opt/plesk/php/7.1/etc/php.d/memcached.ini

and reread php handlers with

# plesk bin php_handlers --reread

That's all.
 
Last edited:
Hi Igor, and thanks....

This is what I have right now:

root@xxxxx:~# /opt/plesk/php/7.1/bin/pecl install memcached
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/memcached.so' - libmemcached.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
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.0.2.tgz ...
Starting to download memcached-3.0.2.tgz (77,063 bytes)
............done: 77,063 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] : I run just enter on this


configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/tmp/memcached/configure --with-php-config=/opt/plesk/php/7.1/bin/php-config --with-libmemcached-dir=no' failed


I run:
root@xxxxxx:~# plesk bin php_handlers --reread
Unknown Plesk command-line utility: "php_handlers"
 
Hi Igor and thanx again.

Here is results of every command I run:


# apt-get install libsasl2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsasl2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.




#apt-get install make plesk-php71-dev gcc libmemcached-dev git pkg-config zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
git is already the newest version.
libmemcached-dev is already the newest version.
make is already the newest version.
pkg-config is already the newest version.
zlib1g-dev is already the newest version.
The following extra packages will be installed:
plesk-php71 plesk-php71-bcmath plesk-php71-cli plesk-php71-dba
plesk-php71-enchant plesk-php71-fpm plesk-php71-gd plesk-php71-imap
plesk-php71-intl plesk-php71-ldap plesk-php71-mbstring plesk-php71-mcrypt
plesk-php71-mysql plesk-php71-odbc plesk-php71-opcache plesk-php71-pdo
plesk-php71-pgsql plesk-php71-process plesk-php71-pspell plesk-php71-snmp
plesk-php71-soap plesk-php71-tidy plesk-php71-xml plesk-php71-xmlrpc
The following packages will be upgraded:
plesk-php71 plesk-php71-bcmath plesk-php71-cli plesk-php71-dba
plesk-php71-dev plesk-php71-enchant plesk-php71-fpm plesk-php71-gd
plesk-php71-imap plesk-php71-intl plesk-php71-ldap plesk-php71-mbstring
plesk-php71-mcrypt plesk-php71-mysql plesk-php71-odbc plesk-php71-opcache
plesk-php71-pdo plesk-php71-pgsql plesk-php71-process plesk-php71-pspell
plesk-php71-snmp plesk-php71-soap plesk-php71-tidy plesk-php71-xml
plesk-php71-xmlrpc
25 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Need to get 13.2 MB of archives.
After this operation, 22.5 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://autoinstall.plesk.com/debian/PHP71_17/ wheezy/all plesk-php71-pdo amd64 7.1.2-debian7.0.17021713 [554 kB]
....
Get:25 http://autoinstall.plesk.com/debian/PHP71_17/ wheezy/all plesk-php71 amd64 7.1.2-debian7.0.17021713 [499 kB]
Fetched 13.2 MB in 1s (7,964 kB/s)
Reading changelogs... Done
(Reading database ... 128361 files and directories currently installed.)
Preparing to replace plesk-php71-pdo 7.1.1-debian7.0.17011917 (using .../plesk-php71-pdo_7.1.2-debian7.0.17021713_amd64.deb) ...
Unpacking replacement plesk-php71-pdo ...
....
Unpacking replacement plesk-php71-fpm ...
Preparing to replace plesk-php71 7.1.1-debian7.0.17011917 (using .../plesk-php71_7.1.2-debian7.0.17021713_amd64.deb) ...
Unpacking replacement plesk-php71 ...
Setting up plesk-php71 (7.1.2-debian7.0.17021713) ...
Installing new version of config file /opt/plesk/php/7.1/etc/php.ini ...
.....
Setting up plesk-php71-fpm (7.1.2-debian7.0.17021713) ...

# /opt/plesk/php/7.1/bin/pecl install memcached
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/7.1/lib/php/modules/memcached.so' - libmemcached.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
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.0.3.tgz ...
Starting to download memcached-3.0.3.tgz (77,310 bytes)
..................done: 77,310 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-rootaHSGIy/memcached-3.0.3
running: /tmp/memcached/configure --with-php-config=/opt/plesk/php/7.1/bin/php-config --with-libmemcached-dir=no
...........
checking for PHP includes... -I/opt/plesk/php/7.1/include/php -I/opt/plesk/php/7.1/include/php/main -I/opt/plesk/php/7.1/include/php/TSRM -I/opt/plesk/php/7.1/include/php/Zend -I/opt/plesk/php/7.1/include/php/ext -I/opt/plesk/php/7.1/include/php/ext/date/lib
checking for PHP extension directory... /opt/plesk/php/7.1/lib/php/modules
checking for PHP installed headers prefix... /opt/plesk/php/7.1/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
.........
checking for session includes... /opt/plesk/php/7.1/include/php
checking for memcached session support... enabled
checking for memcached igbinary support... disabled
checking for memcached msgpack support... disabled
checking for libmemcached location... found version 1.0.8, under /usr
checking whether libmemcached supports sasl... no
configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/tmp/memcached/configure --with-php-config=/opt/plesk/php/7.1/bin/php-config --with-libmemcached-dir=no' failed

# apt-get install libsasl2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsasl2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

I have just memcache activated on my PHP:

ff38d15c7b0e4c4090685b254a2a0c39.png

But not memcached
Regards
 
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/7.1/lib/php/modules/memcached.so' - libmemcached.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
Looks like you have already installed memcached.so module but it is not loaded due to problems with libmemcached.so.11 loading. So, you do not need to compile it again. It is necessary to deal with the problem of loading libmemcached.so.11.

For example, on my Debian Jessie I see following:

# ls -la /usr/lib/x86_64-linux-gnu/libmemcached.so.11
lrwxrwxrwx 1 root root 22 Nov 13 2014 /usr/lib/x86_64-linux-gnu/libmemcached.so.11 -> libmemcached.so.11.0.0

The file belongs to libmemcached11 package:

# dpkg -S /usr/lib/x86_64-linux-gnu/libmemcached.so.11
libmemcached11:amd64: /usr/lib/x86_64-linux-gnu/libmemcached.so.11

Make sure that this package is installed.
 
Unfortunately, I can not figure out this.


#ls -la /usr/lib/x86_64-linux-gnu/libmemcached.so.10
lrwxrwxrwx 1 root root 22 Jun 5 2012 /usr/lib/x86_64-linux-gnu/libmemcached.so.10 -> libmemcached.so.10.0.0

#dpkg -S /usr/lib/x86_64-linux-gnu/libmemcached.so.10
libmemcached10:amd64: /usr/lib/x86_64-linux-gnu/libmemcached.so.10


# ls -la /usr/lib/x86_64-linux-gnu/libmemcached.so.11
ls: cannot access /usr/lib/x86_64-linux-gnu/libmemcached.so.11: No such file or directory

# dpkg -S /usr/lib/x86_64-linux-gnu/libmemcached.so.11
dpkg-query: no path found matching pattern /usr/lib/x86_64-linux-gnu/libmemcached.so.11


This driving me crazy ...

Thank you Igor
 
# apt-get install libmemcached11
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libmemcached11
 
Here is the list of commands for Plesk Onyx and Ubuntu 16.04:
apt install plesk-php71-dev gcc make git pkg-config zlib1g-dev libmemcached11 libmemcached-dev
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached/
git checkout php7
/opt/plesk/php/7.1/bin/phpize
./configure --disable-memcached-sasl --with-php-config=/opt/plesk/php/7.1/bin/php-config
make && make install
echo "extension=memcached.so" > /opt/plesk/php/7.1/etc/php.d/memcached.ini
plesk bin php_handler --reread
 
Back
Top