mkdir /soft cd /soft wget http://memcached.org/files/memcached-1.4.29.tar.gz tar -zxvf memcached-1.4.29.tar.gz cd memcached-1.4.29 ./configure --prefix=/usr/local/memcached make && make install /usr/local/memcached/bin/memcached -d -m 200 -u root -p 11211 -P /tmp/memcached.pid cd /soft wget http://pecl.php.net/get/memcache-3.0.8.tgz tar -zxvf memcache-3.0.8.tgz cd memcache-3.0.8 /phpstudy/server/php/bin/phpize ./configure --with-php-config=/phpstudy/server/php/bin/php-config make && make install #最后留一下目录 /phpstudy/server/php/lib/php/extensions/no-debug-non-zts-20121212/ vi /phpstudy/server/php/etc/php.ini #搜索.so/.so #在其附近添加如下代码,目录是上面的目录 extension=/phpstudy/server/php/lib/php/extensions/no-debug-non-zts-20121212/memcache.so #保存,重启web服务器