如何在WAMP中启用记忆快取 [英] How to enable memcache in WAMP
本文介绍了如何在WAMP中启用记忆快取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在WAMP中安装内存缓存?
How to install memcache in WAMP?
我在php.ini
中找不到任何php_memche.
I don't find any php_memche in php.ini
.
我现在该怎么办?
@Ryan
感谢您的步骤,现在在WAMP中启用了内存缓存,我也对PHPINFO进行了交叉检查.正在显示内存缓存.
thanks for your step, now memcache enabled in WAMP, i have cross checked in the PHPINFO as well. memcache is displaying.
我在下面的示例Memcache示例中进行了尝试.但会引发错误.
i have tried below example memcache sample. but throwing error.
<?php
$memcache = new Memcache;
$memcache->connect('localhost:8085', 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";
var_dump($get_result);
?>
得到以下通知错误.
( ! ) Notice: Memcache::getversion() [memcache.getversion]: Server localhost:8085 (tcp 11211) failed with: Malformed version string (0) in C:\wamp\www\memcache\sample.php on line 7
我错过了...
推荐答案
以下是对我有用的步骤:
Here are the steps that worked for me:
所需文件
-
memcached.exe
直接链接 -
MSVCP71.DLL
Windows DLL文件 -
msvcr71.dll
-
php_memcache.dll
适用于PHP 5.3.4的内存缓存或REF
memcached.exe
Direct LinkMSVCP71.DLL
Windows DLL Filesmsvcr71.dll
php_memcache.dll
Working memcache for PHP 5.3.4 OR REF
步骤
- 将
MSVCP71.DLL
,msvcr71.dll
复制到C:\windows\sysWOW64
- 将
memcached.exe
复制到C:\memcached
- 点击Windows键
- 类型:CMD
- 按:Ctrl-Shift-Enter
- 选择
yes
- 类型:
C:\memcached\memcached.exe -d install
- 类型:
C:\memcached\memcached.exe -d start
- 将
php_memcache.dll
复制到C:\wamp\bin\php\php5.3.4\ext
- 使用Wamp控件重新启动Apache
- 启用WAMP-> PHP-> PHP扩展-> php_memcache
- Copy
MSVCP71.DLL
,msvcr71.dll
toC:\windows\sysWOW64
- Copy
memcached.exe
intoC:\memcached
- Click Windows-Key
- Type: CMD
- press: Ctrl-Shift-Enter
- Choose
yes
- type:
C:\memcached\memcached.exe -d install
- type:
C:\memcached\memcached.exe -d start
- Copy
php_memcache.dll
toC:\wamp\bin\php\php5.3.4\ext
- Restart Apache using Wamp controls
- Enable WAMP -> PHP -> PHP Extensions -> php_memcache
这篇关于如何在WAMP中启用记忆快取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文