gpt4 book ai didi

php - 内存缓存不能在 Windows 上运行?

转载 作者:行者123 更新时间:2023-12-05 08:59:59 24 4
gpt4 key购买 nike

我安装了 memcached,我还通过键入 net start "memcached Server"启动了该服务,它说该服务已经启动,所以我重新启动了 apache 并尝试了一些使用 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 :在第 3 行的 C:\wamp\www\temp.php 中找不到类 'Memcache'这是否意味着内存缓存未启动或其他任何内容?除了安装和启动服务,我什么都没做我是否需要做任何其他事情,比如指定 RAM 和添加服务器或其他任何事情?我正在使用 wamp 服务器。

最佳答案

以下是对我有用的步骤:

网址:How to enable memcache in 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(),它没有显示内存缓存属性。任何人都可以帮助我安装 wmap。

--谢谢D.吉瓦

关于php - 内存缓存不能在 Windows 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10809921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com