I'm trying to create a connection from my PHP application to Memcache, however I keep getting the error 'Could not establish Memcached connection'.
Here's my package version information
Laravel Version: 5.0.32
PHP Version:5.4.39-0+deb7u2
Database Driver & Version:mysql Ver 14.14 Distrib 5.5.31
Server&Version :Debian:7.1.
-memcached:1.4.13-0.2
-php5-memcached:2.0.1-6
I have ensured that memcached is running, as executing service memcached status
yields "memcached is running".
I have two servers where my project is deployed:
Is there a version conflict?
Fixed by myself. My solution as follow: 1.delete memcache file and apc file in config dir 2.restart php5-fpm and memcached service. Although issue is fixed, but I'm still not figure out why it was triggered. This issue only occurs on the server with Debian os installed rather than the other server which with ubuntu os installed. Hope help somebody~
我用sudo apt-get install memcached sudo service memcached status sudo service memcached start
解决了这个问题sudo apt-get install memcached sudo service memcached status sudo service memcached start
You need to first install memcached :
sudo apt install memcached
Then you need to start it :
sudo service memcached start
After that it will connect. I resolve it by above step in my case.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.