首页 > php开发 > php配置memcache缓存方法

php配置memcache缓存方法

1、下载memcache  放到自己的盘符下面  例如:d:memcached

2、开始->cmd->输入命令d:memcachedmemcached.exe -d install  安装

3、安装完成后输入d:memcachedmemcached.exe -d start 

4、下载php_memcache.dll,注意自己的php版本的文件 放到你的php下的ext/下面

5、在php.ini 加入一行 extension=php_memcache.dll

6、重启apache 查看你的phpinfo里面是否有memcache,如果有就说明成功安装

7、测试代码,代码如下:

<?php 
	$mem = new Memcache; 
	$mem->connect("127.0.0.1",11211); 
	$mem->set('key','test memcache successfull',0,100); 
	$val=$mem->get('key');//开源代码phprm.com 
	echo $val; 
	 

如果输出了“test memcache successfull”说明安装成功了.

教程地址:http://www.phprm.com/develop/fs5013.html

欢迎转载!但请带上文章地址^^

标签:php缓存 memcache缓存

相关文章

发表留言