windows下XAMPP装配php_memcache扩展

WBOY
Release: 2016-06-13 12:22:00
Original
774 people have browsed it

windows下XAMPP安装php_memcache扩展
首先下载phpmemcache,地址为:

http://up.2cto.com/2012/0522/20120522094758371.rar

解压下的文件,解压后有以下文件:


接着以管理员身份打开cmd,进入刚才解压的目录,

安装memcache:

memcached.exe -d install
Copy after login

接着启动memcache服务:

memcached.exe -d start
Copy after login
这样memcache服务就安装好了。

接着往XAMPP中加入phpmemcache扩展。

卸载memcache服务命令为:

memcached.exe -d uninstall
Copy after login

停止memcache服务命令为:

memcached.exe -d stop
Copy after login

首先在htdocs下新建一个文件1.php,输入以下内容:

<?php echo phpinfo();?>
Copy after login
Copy after login
接着启动apache服务器,在浏览器中输入localhost/1.php,返回以下信息
Copy after login


这就是你的php的版本信息,大概是以下这样子:


需要注意的是Architecture和顶部的php version这两部分;

接着下载php_memcache.dll,地址为:http://pecl.php.net/package/memcache/3.0.8/windows

记得要找对你的版本,我下载的是以下版本:


解压下载的文件,把里面的php_memcache.dll拷贝到xampp/php/ext下。

然后打开php.ini(在xampp/php下),在末尾添加以下内容:

;php-memcachedextension=php_memcache.dll[Memcache]memcache.allow_failover = 1memcache.max_failover_attempts=20memcache.chunk_size =8192memcache.default_port = 11211
Copy after login

保存并退出,重启你的apache服务器就可以了。


值得注意的是,如果你使用的thinkphp框架,那么默认使用的缓存是File,你可以在配置文件中修改为Memcache,方法如下:

打开thinkphp/ThinkPHP/Conf/convention.php,找到'DATA_CACHE_TYPE'这一项,改为Memcache,保存并退出就可以了。

Related labels:
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
Popular Tutorials
More>
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!