--------window下使用memcache缓存-----
php版本 5.4
1. 下载window_memcache.rar。
http://pan.baidu.com/s/1nvqjpUh
2. 解压,能看到x86,x64 分别对应32位和64位系统,
以及一个php_memcache.dll
3. 把php_memcache.dll 放到php安装目录对应版本的拓展目录下etx。
4. 打开php.ini 在最后一行加上extension=php_memcache.dll
5. 重启apache服务器,查看phpinfo搜索有没有memcache
6. 把对应系统的对应的memcached.exe放到硬盘下,如放到d盘
7. 打开cmd,
>d:
>memcached –d install
>memcached –d start
>memcached -l 127.0.0.1 –p 80 –m 128
8. 在任务管理器能看到memcache.exe 表明运行成功
其中memcached参数说明
-p 监听的端口
-l 连接的IP地址,默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
-d stop|shutdown 关闭正在运行的memcached服务
-d install 安装memcached服务
-d uninstall 卸载memcached服务
-u 以的身份运行 (仅在以root运行的时候有效)
-m 最大内存使用,单位MB。默认64MB
-M 内存耗尽时返回错误,而不是删除项
-c 最大同时连接数,默认是1024
-f 块大小增长因子,默认是1.25
-n 最小分配空间,key+value+flags默认是48
-h 显示帮助
9. memcache基本操作
echo $memcache->get('key'); $memcache->replace('key',"123456"); echo "<br>"; echo $memcache->get('key'); $memcache->delete('key'); print_r($memcache->get('key'));
具体操作,请网上查找。