一 首先声明很重要的我问题 确认好本身系统是 32位仍是64位 以及使用的php集成环境的版本号和32位64位php
二 下载并安装memcached服务器端软件
32位系统 1.2.5版本:http://static.runoob.com/down...
32位系统 1.2.6版本:http://static.runoob.com/down...
32位系统 1.4.4版本:http://static.runoob.com/down...
64位系统 1.4.4版本:http://static.runoob.com/down...
32位系统 1.4.5版本:http://static.runoob.com/down...
64位系统 1.4.5版本:http://static.runoob.com/down...
下载后解压到任意盘
cmd 中进行安装
以管理员身份运行 cmd.exe,并转至memcached所在文件夹。并安装memcached
c:memcachedmemcached.exe -d install(安装)
c:memcachedmemcached.exe -d start(开启)
而后去任务管理器中进程查看memcached服务是否已经启动。windows
四、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 显示帮助浏览器
五、memcached的中止与卸载命令
三 PHP安装memcache扩展
下载memcache.dll扩展服务器
下载地址:http://pecl.php.net/package/m...
根据本身php 版本号和集成环境的位数进行下载
将其中的php_memcache.dll 扩展文件拷贝到 php 的扩展目录中
在php.ini中添加
extension=php_memcache.dll
重启一下环境 使用phpinfo()查看memcache是否安装成功
4、PHP程序测试memcache功能本地是否可用
<?phpmemcached
$memcache = new Memcache;
$memcache->connect('127.0.0.1',11211) or die('shit');测试
$memcache->set('key','hello memcache!');spa
$out = $memcache->get('key');.net
echo $out;
而后经过浏览器访问该文件,正常结果能够看到输入:
hello memcache!rest