参考链接:http://blog.csdn.net/u011470322/article/details/41055659

http://blog.sina.com.cn/s/blog_5dce657a0100wyfk.html

 

php的memcache扩展篇

1、下载memcache源码:http://pecl.php.NET/package/memcache  //下载稳定版stable,否则可能出现

$memcache->connect('localhost', 11211);服务器中断的情况

2、tar xzf memcache

3、cd memcache

4、/Applications/XAMPP/xamppfiles/bin/phpize --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

5、./configure -with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

 

6、make & make install

7、cp ./ modules/memcache.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226(make步骤已完成)

8、phpinfo()查看memcache扩展

 

linux下memcached安装

1、memcached依赖libevent,下载libevent库:libevent.org

2、memcached下载:memcached.org

3、cd libevent

4、./configure --prefix=/usr/local/Cellar/   //编译libevent,出错读报错信息,一般为缺少以来的库

5、make && make install

 

mac下安装memecached

1、使用brew安装,傻瓜式安装

参考:http://blog.csdn.net/whereismatrix/article/details/50485570

brew install memcached

进入/usr/local/Cellar/,即可看到libevent和memcached的目录

2、自己编译安装

参考:Mac MAMP安装Memcached  http://blog.csdn.net/last_sharly/article/details/51492593

 

mac下安装memcached扩展:http://pecl.php.net/package/memcached  //下载稳定版本stable

 

mac下安装php的redis扩展

1、下载redis源码:http://pecl.php.NET/package/redis  //下载稳定版stable,否则可能出现

2、tar xzf redis

3、cd redis

4、/Applications/XAMPP/xamppfiles/bin/phpize --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

5、./configure -with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

 

6、make & make install

7、cp ./ modules/redis.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/redis.so(make步骤已完成),修改php.ini,加载redis.so

8、phpinfo()查看redis扩展

 

mac安装redis的服务

1、redis官网http://redis.io

2、cd redis

3、make

4、make PREFIX=/usr/local/Cellar/redis install //制定安装目录

5、启动redis:/usr/local/Cellar/redis/bin/redis-server redis.conf 译指定config启动redis