zl程序教程

您现在的位置是:首页 >  系统

当前栏目

windows环境下php配置memcache的具体操作步骤

WindowsPHP配置 环境 具体 操作步骤 memcache
2023-06-13 09:15:01 时间

首先要安装好php和apache环境。
我用的是wamp整合的套件
php5.2.8
apache2.2.1.1
这些都准备好了后,
就到memcache官网去下载windows下的memcache.exe这个程序

然后把他放在c:\memcache目录下
打开cmd命令输入
cdc:\memcache

安装
memcache.exe-pinstall

安装完成后
memcache.exe-pstart

成功开启memcache后

就到php/ext目录下把php_memcache.dll放到里面

然后在php目录下的php.ini增加一段内容
extension=php_memcache.dll

加完之后,重启apache

然后在php页面输出phpinfo();

检查memcache是否成功加载了。


如果成功加载了,就可以在一个php页面做memcache测试了

<?php
//phpinfo();

$memcache=newMemcache;
$memcache->connect("127.0.0.1",11211)ordie("shit");

$memcache->set("key","hellomemcache!");

$out=$memcache->get("key");

echo$out;

成功的话会输出

hellomemcache!