php 在 Windows 7 (XAMPP) 中安装内存缓存
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21029746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing memcache in Windows 7 (XAMPP)
提问by luqita
I'm using Windows 7, 64 bits, and PHP 5.3.5.
我使用的是 Windows 7、64 位和 PHP 5.3.5。
memcache is showing as this in phpinfo:
memcache 在 phpinfo 中显示如下:
Active persistent connections: 0
Version: 2.2.5
Revision: $Revision: 1.114 $
And I'm also getting a connection error Notice: Memcache::get() [memcache.get]: Server localhost (tcp 11211) failed
而且我也收到连接错误 Notice: Memcache::get() [memcache.get]: Server localhost (tcp 11211) failed
This is what I did:
这就是我所做的:
1) I installed and ran the 64 bit memcached service: http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip.
1)我安装并运行了 64 位 memcached 服务:http: //s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip。
2) I copied php_memcache.dll (https://thinkam.googlecode.com/files/php_memcache-cvs-20090703-5.3-VC6-x86.zip) into php/ext.
2) 我将 php_memcache.dll ( https://thinkam.googlecode.com/files/php_memcache-cvs-20090703-5.3-VC6-x86.zip)复制到 php/ext 中。
3) I added extension = php_memcache.dllin php.ini.
3)我extension = php_memcache.dll在php.ini中添加。
4) I restarted XAMPP.
4) 我重新启动了 XAMPP。
What could I be missing?
我可能会错过什么?
* Update *
* 更新 *
Memcache seems to be listening now on port 11211, but now from my application I get the following error:
Memcache 现在似乎正在侦听端口 11211,但现在从我的应用程序中我收到以下错误:
Notice: Memcache::get() [memcache.get]: Server 127.0.0.1 (tcp 11211) failed with: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)
注意: Memcache::get() [memcache.get]: Server 127.0.0.1 (tcp 11211) failed with: A connection attempt failed 因为连接方在一段时间后没有正确响应,或者建立连接失败因为连接的主机未能回应。(10060)
回答by voodoo417
You must run memcached serverin Windows Control Panel->Administration->Services.
您必须memcached server在 Windows 中 运行Control Panel->Administration->Services。
回答by Rhod Pumaras
Run path/memcache.exe -d startand make sure memcache is started
运行path/memcache.exe -d start并确保内存缓存已启动
回答by Pavel Kenarov
As @Gigala say in comments you can get another php_memchace.dll for different php versions from here http://windows.php.net/downloads/pecl/releases/memcache/3.0.8
正如@Gigala 在评论中所说,您可以从这里获得另一个 php_memchace.dll 用于不同的 php 版本http://windows.php.net/downloads/pecl/releases/memcache/3.0.8
Download the extension for your php version following this example:
按照此示例下载适用于您的 php 版本的扩展程序:
php_memcache-3.0.8-5.3-nts-vc9-x86.zipas "5.3"must be your php version
php_memcache-3.0.8-5.3-nts-vc9-x86.zipas "5.3"必须是你的php版本
This works for me
这对我有用

