我使用的是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)
您必须在WindowsControl Panel->Administration->Services
中运行memcached server
。
运行path/memcache.exe -d start
并确保memcache已启动
正如@Gigala在评论中所说,您可以从这里获得另一个适用于不同php版本的php_memchace.dllhttp://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版本
这对我有效