标签:linux
十一周三次课(3月8日),以下以安装一个redis的模块为例.
1.我们可先查看php是否有redis模块
/usr/local/php7/bin/php -m |grep redis #查看php加载的模块
2.下载,解压和安装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
以下为生成configure文件,因为默认没有configure文件:
/usr/local/php7/bin/phpize
配置,编译,安装redis:
./configure --with-php-config=/usr/local/php7/bin/php-config
make && make install
查看扩展模块存放目录,我们可以在php.ini中去自定义该路径
/usr/local/php7/bin/php -i |grep extension_dir
修该php配置文件以加载新安装的模快:
vim /usr/local/php7/etc/php.ini
增加一行配置(可以放到文件最后一行)
extension = redis.so
查看加载结果:
/usr/local/php7/bin/php -m|grep redis
扩展
apache rewrite教程 http://coffeelet.blog.163.com/blog/static/13515745320115842755199/
http://www.cnblogs.com/top5/archive/2009/08/12/1544098.html
apache rewrite 出现死循环 http://ask.apelearn.com/question/1043
php错误日志级别参考 http://ask.apelearn.com/question/6973
php开启短标签 http://ask.apelearn.com/question/120
php.ini详解 http://legolas.blog.51cto.com/2682485/493917
标签:linux
原文地址:http://blog.51cto.com/4375471/2084407