如何在WAMP中启用记忆快取 [英] How to enable memcache in WAMP

查看:235
本文介绍了如何在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 Direct Link
  • MSVCP71.DLL Windows DLL Files
  • msvcr71.dll
  • php_memcache.dll Working memcache for PHP 5.3.4 OR REF

步骤

  1. MSVCP71.DLLmsvcr71.dll复制到C:\windows\sysWOW64
  2. memcached.exe复制到C:\memcached
  3. 点击Windows键
  4. 类型:CMD
  5. 按:Ctrl-Shift-Enter
  6. 选择yes
  7. 类型:C:\memcached\memcached.exe -d install
  8. 类型:C:\memcached\memcached.exe -d start
  9. php_memcache.dll复制到C:\wamp\bin\php\php5.3.4\ext
  10. 使用Wamp控件重新启动Apache
  11. 启用WAMP-> PHP-> PHP扩展-> php_memcache
  1. Copy MSVCP71.DLL, msvcr71.dll to C:\windows\sysWOW64
  2. Copy memcached.exe into C:\memcached
  3. Click Windows-Key
  4. Type: CMD
  5. press: Ctrl-Shift-Enter
  6. Choose yes
  7. type: C:\memcached\memcached.exe -d install
  8. type: C:\memcached\memcached.exe -d start
  9. Copy php_memcache.dll to C:\wamp\bin\php\php5.3.4\ext
  10. Restart Apache using Wamp controls
  11. Enable WAMP -> PHP -> PHP Extensions -> php_memcache

这篇关于如何在WAMP中启用记忆快取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆