Can not add Memcached back?

Tommyhara

Verified User
Joined
Jul 25, 2014
Messages
185
Hello,

Before upgraded to PHP7, I used PHP5.6 and installed Memcached successfully on my VPS and used it.

But, after installed PHP7

I got this error on PHP7

Code:
[root@serverh ~]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0


I downgraded PHP back to PHP 5.6

But now the error is still appearing when I added

Code:
extension=memcache.so

to

Code:
/usr/local/lib/php.ini


on PHP 5.6, the error is:

Code:
[root@serverh ~]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0

PHP 5.6.25 (cli) (built: Sep 13 2016 01:27:52)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies


Now I can not use Memcached on PHP 5.6 like before.


Does any one know how to solve this problem?


Thanks in advance!
 
Hello,

You need to rebuild the extension after PHP version changes.

oh this is the first time I've ever heard about this, i think it can solve my problem with memcached.

Can you guide me on how to rebuild the extension after PHP version changes?


Thanks zEitEr!
 
It would mean that

Code:
pecl install memcache

it showed this

Code:
[root@server ~]# pecl install memcache
pecl/memcache is already installed and is the same as the released version 2.2.7
install failed

failed with an error. You need to build the extension manually with phpize and the others. I won't post here commands to run as they already were posted many times, and an example can be found here:

https://help.directadmin.com/item.php?id=400

Thanks I am looking into this.

I found a post mentioned to recompile php

http://forum.directadmin.com/showthread.php?t=24448

at step 3 but it didn't show in details.
 
Hello zEitEr,

from this link
https://help.directadmin.com/item.php?id=400

you mean I should install memcached this way

Code:
yum install libevent libevent-devel

Code:
cd /usr/local/src

Code:
wget https://memcached.org/files/memcached-1.4.31.tar.gz

Code:
tar xvzf memcached-1.4.31.tar.gz
Code:
cd memcached-1.4.31



Code:
./configure


Code:
./configure --enable-threads --enable-64bit



Code:
make && make install

I run to this step and restart memcached

Code:
service memcached start

also, tried to add

Code:
extension_dir="/usr/local/lib/php/extensions/no-debug-non-zts-20131226/"
extension=memcache.so
to php.ini

restart apache to reload php.ini
Code:
service httpd restart


but when check php -v

still the same result and its still error
also check with phpinfo() there no memcache module there.


PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.25 (cli) (built: Sep 13 2016 05:39:46)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

maybe I need to reinstall Directadmin?
but this will consume more time.
 
Back
Top