Installing Memcached on Debian and DirectAdmin

Thommen

New member
Joined
Feb 22, 2021
Messages
14
I did
apt install libmemcached-tools php-memcached memcached

To the file
/usr/local/php72/lib/php.ini
I added
extension = "/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so"
and did
cp /usr/lib/php/20180731/memcached.so /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/
Now I have
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so' (tried: /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so: undefined symbol: zend_string_init_interned), /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so.so (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/memcached.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP 7.2.34 (cli) (built: Feb 23 2021 17:40:57) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Where did I go wrong
 
You need to manual complier php-extension by yourself

example
Code:
cd /usr/local/src
wget https://github.com/php-memcached-dev/php-memcached/archive/v3.1.5.tar.gz
tar -xzvf php-memcached-3.1.5.tar
cd php-memcached
/usr/local/php72/bin/phpize
./configure --with-php-config=/usr/local/php72/bin/php-config
make
make install

after install, you will see something like
"shared extensions: /usr/local/php72/lib/php/extensions/no-debug-non-zts-*/"
that locate your module file
 
Thank you for your quick help. Your help helped me...
Does this work with packages?
libmemcached-tools php-memcached memcached libmemcached-dev
 
Last edited:
memcache service
You can install by apt/yum
apt-get install memcache

because php-module just integrate api with memcache
besure you change some config of Memcache service like memory usage


More information, Please read on "memcache development" directly

Thanks
 
It is correct. Now it started working (I reinstalled memcached). Thank you again for your help:giggle:
 
When I run the command
/usr/local/php74/bin/phpize
./configure --with-php-config=/usr/local/php74/bin/php-config
make

always show error No targets specified and no makefile found. stop
 
Back
Top