添加php的扩展模块
1.下载 memcache-2.2.5.tgz
2.tar zxf memcache-2.2.5.tgz
3.cd memcache-2.2.5
4.vim ~/.bash_profile
写入:
10 PATH=$PATH:$HOME/bin:/usr/local/lnmp/mysql/bin:/usr/local/lnmp/nginx/sbin:/usr/local/lnmp/php/bin
5.source ~/.bash_profile
6.phpize
7../configure
8.make
9.make install
10.cd /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/
11.vim /usr/local/lnmp/php/etc/php.ini
编辑:
873 extension=memcache.so
12./etc/init.d/php-fpm reload
13.php -m | grep memcache
14.cd
15.yum install memcached -y
16./etc/init.d/memcached start
17.cd memcache-2.2.5
18.cp memcache.php example.php /usr/local/lnmp/nginx/html/
19.cd /usr/local/lnmp/nginx/html/
20.vim memcache.php
写入:
23 define('ADMIN_PASSWORD','westos'); // Admin
Password
28 $MEMCACHE_SERVERS[] = 'localhost:11211'; // add more as an array
21.在浏览器中分别访问172.25.6.1/example.php
172.25.6.1/memcache.php
22.可以在物理机中作压力测试
ab -c 10 -n 1000 http://172.25.6.1/example.php