Could not install Memcached back?

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
744
Best answers
0
Ratings
279 1
Points
63
#1
Hello,

Before upgraded to PHP7 on my VPS, I used PHP 5.6 and installed Memcached successfully on my VPS and used it for my websites.

But, after installed PHP7, I got this error on the VPS with PHP7

# 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 7 back to PHP 5.6

But it is still showing same error when checking with php -v

Code:
[[email protected] ~]# 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
the problem is, when I add memcache module into PHP

Code:
extension=memcache.so
to

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

then it didn't work like before.

It showed error when checking with php -v

Code:
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
and memcache module doesn't appear when checking with phpinfo() any more.

Does any one know how to solve this problem?


Thanks in advance!
 

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
744
Best answers
0
Ratings
279 1
Points
63
#3
Yes you just have to remove the file memcache.ini from /etc/php/fpm/5.6 or 7/modules
It's because php try to load an extension which doesn't exist
Thanks but there is not memcache.ini in /etc/php/fpm/5.6 or 7, also doesn't have these folders on my VPS

I also tried all ways from all sites by searching on Google but could not fix this problem.

After 15 minutes asked this question, I could find the solution to fix the problem by myself and I could add memcache.so to php.ini without any problems.

and memcache module could add to PHP and it working like before (when I4 used php 5.6)

The solution is very simple

when I tried to reinstall memcache php then it alerted this

Code:
[[email protected] ~]# pecl install memcache
pecl/memcache is already installed and is the same as the released version 2.2.7
install failed
and I could not install memcache php again

so I tried to uninstall memcache php first

Code:
pecl install memcache
After uninstall memcache, I can install memcache php back with the command

pecl install memcache
And adding add extension=memcache.so to /usr/local/lib/php.ini as normally

Restart web server

Code:
Service httpd restart
And the problem is SOLVED!

I hope someone can find this and fix the problem if they have same problem as me.

Hope it helps!
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,606
Best answers
4
Ratings
449 13
Points
83
#4
Sorry it's the folder structure for Debian/Ubuntu, not for Centos.
But that's because for php5.6 you can install it from the packages :

php-memcached - memcached extension module for PHP, uses libmemcached
php-memcache - memcache extension module for PHP

And for php7 there is no package yet, so you have to use PECL extension for that purpose.
 
Older Threads
Replies
1
Views
1,042
Replies
3
Views
853
Replies
5
Views
5,631
Newer Threads
Latest Threads
Replies
2
Views
30
Replies
0
Views
33
Replies
4
Views
44
Replies
4
Views
70
Recommended Threads
Similar Threads
Replies
1
Views
1,128
Replies
13
Views
7,328
Replies
2
Views
1,703

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top