php通過pecl方式安裝擴展


安裝pecl

cd /usr/local/php/bin/
wget http://pear.php.net/go-pear.phar -O go-pear.php
php go-pear.php
##回車默認安裝

yum安裝
yum install php-pear

 

安裝php擴展

pecl search key-word    #查找擴展
pecl install key-word   #安裝擴展

 

查詢相關擴展

[root@localhost src]# pecl search swoole
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
swoole  1.8.12 (stable) 1.8.12 Event-driven asynchronous and concurrent networking engine with high performance for PHP.
[root@localhost src]# pecl search xdebug
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
xdebug  2.4.1 (stable)        Provides functions for function traces and profiling

 

安裝相關擴展

pecl install xdebug
##安裝完成之后,輸出
Build process completed successfully
Installing '/usr/lib64/php/modules/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.4.1
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=/usr/lib64/php/modules/xdebug.so" to php.ini
##根據提示,我們在php.ini的最后添加
zend_extension=/usr/lib64/php/modules/xdebug.so
pecl install swoole

 

問題

 configure: error: Cannot find php-config

在/usr/bin下執行 ln -s /usr/local/php/bin/php-config php-config 即可

卸載

php.ini 中刪除 extension=swoole.so

卸載,切換到PHP安裝目錄下的bin

./pecl uninstall swoole(已swoole為例)

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM