php配置memcache缓存方法_PHP教程

WBOY
Release: 2016-07-20 11:10:20
Original
768 people have browsed it

文章简单的介绍了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、测试代码

代码如下 复制代码

$mem = new Memcache;
$mem->connect("127.0.0.1",11211);
$mem->set('key','test memcache successfull',0,100);
$val=$mem->get('key');
echo $val;
?>

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

php_memcache.dll下载:php_memcache-cvs-20090703-5.3-VC6-x86.zip

memcache安装文件下载:memcached-1.2.1-win32.zip


www.bkjia.com true http://www.bkjia.com/PHPjc/444735.html TechArticle 文章简单的介绍了php配置memcache缓存方法以及检测是否配置成功了,入门者可以参考一下。 1、下载memcache 放到自己的盘符下面 例如:d:mem...
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!