方法一:使用yum命令安装
1、yum install libevent-devel
2、pecl install channel://pecl.php.net/libevent-0.1.0
3、echo extension=libevent.so > /etc/php.d/libevent.ini
方法二:phpize安装
tar -zxvf libevent-0.1.0.tgz
cd libevent-0.1.0/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make test
sudo make install
vim /usr/local/php5/etc/php.ini
extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/"
extension=memcache.so
/etc/init.d/php-fpm reload 重新加载配置
装完redis扩展后,修改php.ini 增加 extension=redis.so ,无限重启php,nginx就是不起作用,查看phpinfo后 发现Loaded Configuration File 的值是none,原来php-fpm启动时,没指定php.ini,所以一直都没生效........
启动
/usr/local/php/sbin/php-fpm -y /usr/local/php/etc/php-fpm.conf -c /usr/local/php/etc/php.ini