2 php memcached wamp wampserver
我安装了 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")));
?>
Run Code Online (Sandbox Code Playgroud)
但它给出了一个错误:Fatal error: Class 'Memcache' not found in C:\wamp\www\temp.php on line 3
这是否意味着内存缓存未启动或其他任何东西?除了安装和启动服务之外,我什么都没做,我还需要做其他事情吗,例如指定 RAM 和添加服务器或其他任何事情?我正在使用 wamp 服务器。
小智 5
以下是对我有用的步骤:
所需文件
memcached.exe Direct Link
MSVCP71.DLL Windows DLL Files
msvcr71.dll
php_memcache.dll Working memcache for PHP 5.3.4
Run Code Online (Sandbox Code Playgroud)
脚步
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
Run Code Online (Sandbox Code Playgroud)
然后,我点击了 phpinfo(),它没有显示 memcache 属性。任何人都可以帮助我安装 wmap。
——感谢 D.Jeeva