/usr/local/php/bin/php -m //查看模块
下面安装一个redis的模块
cd /usr/local/src/
wget https://codeload.github.com/phpredis/phpredis/zip/develop
mv develop phpredis-develop.zip
unzip phpredis-develop.zip
cd phpredis-develop
/usr/local/php/bin/phpize //生成configure文件
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
opcache.so redis.so
/usr/local/php/bin/php -m|grep redis //php还没有该模块
/usr/local/php/bin/php -i |grep extension_dir //查看扩展模块存放目录,我们可以在php.ini中去自定义该路径
extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => //编译的扩展模块默认放该目录
vim /usr/local/php/etc/php.ini //增加一行配置(可以放到文件最后一行)
extension = redis.so
/usr/local/php/bin/php -m|grep redis
下面安装一个redis的模块
cd /usr/local/src/
wget https://codeload.github.com/phpredis/phpredis/zip/develop
mv develop phpredis-develop.zip
unzip phpredis-develop.zip
cd phpredis-develop
/usr/local/php/bin/phpize //生成configure文件
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
opcache.so redis.so
/usr/local/php/bin/php -m|grep redis //php还没有该模块
/usr/local/php/bin/php -i |grep extension_dir //查看扩展模块存放目录,我们可以在php.ini中去自定义该路径
extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => //编译的扩展模块默认放该目录
vim /usr/local/php/etc/php.ini //增加一行配置(可以放到文件最后一行)
extension = redis.so
/usr/local/php/bin/php -m|grep redis
Redis
本文转自 虾米的春天 51CTO博客,原文链接:http://blog.51cto.com/lsxme/2055353,如需转载请自行联系原作者