简体   繁体   English

无法建立Memcached连线

[英]Could not establish Memcached connection

I'm trying to create a connection from my PHP application to Memcache, however I keep getting the error 'Could not establish Memcached connection'. 我正在尝试创建从我的PHP应用程序到Memcache的连接,但是我一直收到错误“无法建立Memcached连接”。

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". 我确保memcached正在运行,因为执行service memcached status产生“ memcached正在运行”。

I have two servers where my project is deployed: 我有两台部署项目的服务器:

  • ubuntu, with memcached:2.1.0 installed ubuntu,安装了memcached:2.1.0
  • debian, with memcached:2.0.1 installed debian,安装了memcached:2.0.1

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. 我的解决方案如下:1.在配置目录中删除memcache文件和apc文件。2.重新启动php5-fpm和memcached服务。 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. 仅在安装Debian os的服务器上发生此问题,而不是在安装ubuntu os的其他服务器上发生此问题。 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 : 您需要先安装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. 在我的情况下,我可以通过以上步骤解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM