Home > php教程 > php手册 > php配置memcache缓存方法

php配置memcache缓存方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-25 16:39:02
Original
979 people have browsed it

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(&#39;key&#39;,&#39;test memcache successfull&#39;,0,100); 
	$val=$mem->get(&#39;key&#39;);//开源代码phprm.com 
	echo $val; 
	 
Copy after login

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

教程地址:

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

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template