Memcache环境测试:
运行下面的php文件,如果有输出This is a test!,就表示环境搭建成功。开始领略Memcache的魅力把!
< ?php
$mem = new Memcache;
$mem->connect(”127.0.0.1″, 11211);
$mem->set(’key’, ‘This is a test!’, 0, 60);
$val = $mem->get(’key’);
echo $val;
?>作者: lbsong 时间: 2009-6-18 15:17
不错,不错,谢谢分享作者: lbsong 时间: 2009-6-18 15:17
php_memcache.dll点击,已经无法下载了,水水,另外
memcached 1.2.1 for Win32 有三个版本,下载那个啊,我是win2003
memcached 1.2.1 for Win32 source code (Dec 23, 2006)
memcached 1.2.1 for Win32 binaries (Dec 23, 2006)
patches to add support for Win32 to the code in the svn (Dec 23, 2006)
Fatal error: Class ‘Memcache’ not found in F:\php\memcache.php on line 2
也是出现这个错误。还好解决了。
感觉还是版本问题。
我php用的是5.2.6
下载pecl 5.2.6,里面的php_memceche.dll不好用。
又下载了个5.2.1的php_memceche.dll,终于ok了。
Fatal error: Class ‘Memcache’ not found
我用的是php_memcache.dll php-5.2.1
PHP环境是5.2.6,phpinfo显示安装成功,但不知道为什么出现上面的提示!