Memcache无法在Windows上使用? [英] memcache not working on windows?

查看:87
本文介绍了Memcache无法在Windows上使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了memcached,我也通过键入net start"memcached Server"来启动该服务,它说该服务已经启动,所以我重新启动了apache并尝试了一些使用memcached的代码:

i installed memcached and I also started the service by typing net start "memcached Server" and it said the service already started so i restarted apache and tried a couple of codes for using memcached:

<?php
//phpinfo();
$memcache = new Memcache;
$memcache->connect("localhost",11211); //change if necessary

$tempArray = array('fish', 'cow', 'demon');
$temp = serialize($testArray);

$memcache->add("key", $temp, 60);
print_r(unserialize($memcache->get("key")));


?>

但是它给出了一个错误:Fatal error: Class 'Memcache' not found in C:\wamp\www\temp.php on line 3 这是否意味着memcache没有启动或其他?除了安装和启动服务外,我没有做任何其他事情,是否需要做其他事情,例如指定RAM和添加服务器或其他?我正在使用wamp服务器.

but it gives an error:Fatal error: Class 'Memcache' not found in C:\wamp\www\temp.php on line 3 does this mean memcache is not started or anything else? i have not done anything except installing and starting the service do i need to do anything else like specifying The RAM and adding the server or anything else? I am using wamp server.

推荐答案

以下是对我有用的步骤:

Here are the steps that worked for me:

网址:如何在WAMP中启用内存缓存

所需文件

memcached.exe Direct Link
MSVCP71.DLL Windows DLL Files
msvcr71.dll
php_memcache.dll Working memcache for PHP 5.3.4

步骤

Copy MSVCP71.DLL, msvcr71.dll to C:\windows\sysWOW64
Copy memcached.exe into C:\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 to C:\wamp\bin\php\php5.3.4\ext
Restart Apache using Wamp controls
Enable WAMP -> PHP -> PHP Extensios -> php_memcache

然后,我点击了phpinfo(),它没有显示memcache属性.任何人都可以帮助我安装wmap.

Then, I hit the phpinfo(), it wasn't display the memcache property. Any one can help me to install the wmap.

- 谢谢 杰瓦(D.Jeeva)

-- Thanks D.Jeeva

这篇关于Memcache无法在Windows上使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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