【问题标题】:Installing memcache in Windows 7 (XAMPP)在 Windows 7 (XAMPP) 中安装内存缓存
【发布时间】:2014-01-28 13:35:12
【问题描述】:

我使用的是 Windows 7、64 位和 PHP 5.3.5。

memcache 在 phpinfo 中显示如下:

Active persistent connections: 0
Version: 2.2.5
Revision: $Revision: 1.114 $ 

我也收到了连接错误Notice: Memcache::get() [memcache.get]: Server localhost (tcp 11211) failed

这就是我所做的:

1) 我安装并运行了 64 位 memcached 服务:http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip

2) 我将 php_memcache.dll (https://thinkam.googlecode.com/files/php_memcache-cvs-20090703-5.3-VC6-x86.zip) 复制到 php/ext 中。

3) 我在 php.ini 中添加了extension = php_memcache.dll

4) 我重新启动了 XAMPP。

我可能会错过什么?

* 更新 *

Memcache 现在似乎正在侦听端口 11211,但现在从我的应用程序中我收到以下错误:

注意:Memcache::get() [memcache.get]: 服务器 127.0.0.1 (tcp 11211) 失败:连接尝试失败,因为连接方 一段时间后没有正确响应,或建立 连接失败,因为连接的主机没有响应。 (10060)

【问题讨论】:

标签: php windows apache memcached xampp


【解决方案1】:

您必须在 Windows Control Panel->Administration->Services 中运行 memcached server

【讨论】:

  • 谢谢,但什么也没发生...还有什么可能遗漏的吗?如果我在 cmd 上键入“netstat”,我没有得到那里列出的连接(也许它应该在那里,因为端口 11211 是打开的?)
  • @luqita memcached 作为服务运行?尝试通过netstat 连接到 127.0.0.1:11212
  • 是的,memcached 现在作为服务运行...我现在在 netstat 上看到: TCP [::1]:11211 My-PC:58710 SYN_RECEIVED... 对吗?还是应该“已建立”?
  • 正确...尝试使用Compatibility with Windows XP 添加memcached.exe 的属性。您是否将其安装为Admin
  • 是的,作为管理员.. 它不是 XP,它是 Windows 7。
【解决方案2】:

运行 path/memcache.exe -d start 并确保内存缓存已启动

【讨论】:

    【解决方案3】:

    正如@Gigala 在 cmets 中所说,您可以从这里获得另一个用于不同 php 版本的 php_memchace.dll http://windows.php.net/downloads/pecl/releases/memcache/3.0.8

    按照此示例下载您的 php 版本的扩展:

    php_memcache-3.0.8-5.3-nts-vc9-x86.zip 因为 "5.3" 必须是您的 php 版本

    这对我有用

    【讨论】:

      猜你喜欢
      • 2013-08-03
      • 2012-01-17
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 2014-03-16
      • 2015-08-09
      相关资源
      最近更新 更多