memcached依赖于libevent,首先安装libevent
官方网站 http://libevent.org/
./configure –prefix=/usr/local/libevent
make && make install
memcached安装
官网http://pecl.php.net/package/memcache
wget http://www.danga.com/memcached/dist/memcached-1.0.4.tar.gz
tar -zxvf memcached-1.0.4.tar.gz
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
进入php源码包目录:cd /usr/local/php-5.6.25/ext/openssl
执行命令: cp ./config0.m4 ./config.m4 即可
[root@weidaijie openssl]# /usr/local/php-fpm/bin/phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
./configure --with-php-config=/usr/local/php-fpm/bin/php-config --enable-memcache
make &&make install
上述安装完后会有类似这样的提示:
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-2007xxxx/
把php.ini中的extension_dir = “./”修改为
extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-2007xxxx/”
添加一行来载入memcache扩展:extension=memcache.so
/usr/local/php-fpm/bin/php -m检测有没有memcache模块
service php-fpm restart
service nginx restart