这篇文章主要为大家展示了“如何安装php插件和扩展 ”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“如何安装php插件和扩展 ”这篇文章吧。
phalcon
来源:https://phalconphp.com/zh/download
yum install php-devel php-mysql gcc libtool pcre-devel
yum install wget git
cd /wdzj/source
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
./install
添加扩展到php.ini文件:
#extension=/wdzj/lnmp/php5.6.11/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
cp /wdzj/lnmp/php5.6.11/lib/php.ini /wdzj/lnmp/php5.6.11/lib/php.ini.`date +%F`
echo "extension=/wdzj/lnmp/php5.6.11/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so" >>/wdzj/lnmp/php5.6.11/lib/php.ini
重启php
/etc/init.d/php-fpm restart
php -m |grep phalcon ##如果有就安装成功
Xhprof:
来源:https://segmentfault.com/a/1190000003509917
wget http://pecl.php.net/get/xhprof-0.9.4.tgz
tar -zxvf xhprof-0.9.4.tgz
cd xhprof-0.9.4
cd extension/
phpize
./configure
make
sudo make install
修改php.ini
# cp /wdzj/lnmp/php5.6.11/lib/php.ini /wdzj/lnmp/php5.6.11/lib/php.ini.`date +%F`
# [xhprof]
# extension=/wdzj/lnmp/php5.6.11/lib/php/extensions/no-debug-non-zts-20131226/xhprof.so
# xhprof.output_dir=/tmp
cp /wdzj/lnmp/php5.6.11/lib/php.ini /wdzj/lnmp/php5.6.11/lib/php.ini.`date +%F`
echo "[xhprof]" >>/wdzj/lnmp/php5.6.11/lib/php.ini
echo "/wdzj/lnmp/php5.6.11/lib/php/extensions/no-debug-non-zts-20131226/xhprof.so" >>/wdzj/lnmp/php5.6.11/lib/php.ini
echo "xhprof.output_dir=/tmp" >>/wdzj/lnmp/php5.6.11/lib/php.ini
重启php
/etc/init.d/php-fpm restart
php -m |grep xhprof ##如果有就安装成功
安装 amqp
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
yum install automake -y
tar xf rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
autoreconf -i
./configure --prefix=/wdzj/lnmp/lib/rabbitmq
make
make install
tar xf amqp-1.7.1.tgz
cd amqp-1.7.1
./configure --with-php-config=/wdzj/lnmp/php7.0.12/bin/php-config --with-amqp --with-librabbitmq-dir=/wdzj/lnmp/lib/rabbitmq
make
make install
升级redis插件
cd /wdzj/source/
wget http://pecl.php.net/get/redis-2.2.8.tgz
tar -xzvf redis-2.2.8.tgz
cd redis-2.2.8
/wdzj/lnmp/php5.6.11/bin/phpize
./configure --with-php-config=/wdzj/lnmp/php5.6.11/bin/php-config
make
make install
ll /wdzj/lnmp/php5.6.11/lib/php/extensions/no-debug-non-zts-20131226/
/etc/init.d/php-fpm reload
php -m |grep redis
以上是“如何安装php插件和扩展 ”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程网行业资讯频道!