/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
/usr/local/php/bin/php -i |grep extension_dir //查看擴展模塊存放目錄,咱們能夠在php.ini中去自定義該路徑
vim /usr/local/php/etc/php.ini //增長一行配置(能夠放到文件最後一行)
extension = redis.sophp
[root@Dasoncheng ~]# cd /usr/local/src/ [root@Dasoncheng src]# wget https://codeload.github.com/phpredis/phpredis/zip/develop [root@Dasoncheng src]# mv develop phpredis-develop.zip [root@Dasoncheng src]# unzip phpredis-develop.zip -bash: unzip: command not found [root@Dasoncheng src]# yum install -y unzip [root@Dasoncheng src]# unzip phpredis-develop.zip [root@Dasoncheng src]# cd phpredis-develop/ [root@Dasoncheng phpredis-develop]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. [root@Dasoncheng phpredis-develop]# yum install -y autoconf [root@Dasoncheng phpredis-develop]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 [root@Dasoncheng phpredis-develop]# echo $? 0 [root@Dasoncheng phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config …… [root@Dasoncheng phpredis-develop]# echo $? 0 [root@Dasoncheng phpredis-develop]# make && make install …… See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- Build complete. Don't forget to run 'make test'. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ [root@Dasoncheng phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ opcache.so redis.so [root@Dasoncheng phpredis-develop]# /usr/local/php/bin/php -m |grep redis [root@Dasoncheng phpredis-develop]# /usr/local/php/bin/php -i |grep extension_dir extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 [root@Dasoncheng phpredis-develop]# vim /usr/local/php/etc/php.ini [root@Dasoncheng phpredis-develop]# /usr/local/php/bin/php -m |grep redis redis
至此,php擴展模塊已經安裝完成!謝謝html
apache開啓壓縮 http://www.aminglinux.com/bbs/thread-5528-1-1.html
apache2.2到2.4配置文件變動 http://www.aminglinux.com/bbs/thread-7292-1-1.html
apache options參數 http://www.aminglinux.com/bbs/thread-1051-1-1.html
apache禁止trace或track防止xss http://www.aminglinux.com/bbs/thread-1045-1-1.html
apache 配置https 支持ssl http://www.aminglinux.com/bbs/thread-1029-1-1.htmllinux