本文主要為大家分享php透過pecl方式安裝擴充的實例講解,具有很好的參考價值,希望對大家有幫助。一起跟著小編過來看看吧,希望能幫助大家。
推薦手冊:php完全自學手冊
#1、安裝pecl及建立快捷鍵(若安裝php時已帶可忽略這一步驟安裝步驟)
# cd /usr/local/php/bin/ //可查看是否已带有pecl # wget http://pear.php.net/go-pear.phar -O go-pear.php # php go-pear.php # ln -s /usr/local/php /bin/pecl /usr/bin/pecl
2、查詢是否已經收錄了該擴充功能
# pecl search swoole // swoole为要查询扩展名(以swoole扩展为例) //查询结果: Retrieving data...0% .Matched packages, channel pecl.php.net: ======================================= Package Stable/(Latest) Local swoole 1.9.23 (stable) Event-driven asynchronous and concurrent networking engine with high performance for PHP. swoole_serialize 0.1.1 (beta) the fastest and smallest serialize fucntion bound for php7
3、安裝設定擴充功能
# pecl install swoole //输出结果: Build process completed successfully Installing '/usr/lib64/php/modules/swoole.so' install ok: channel://pecl.php.net/swoole-1.9.23 configuration option "php_ini" is not set to php.ini location You should add "extension=swoole.so" to php.ini # 配置php.ini引用swoole.so然后重启php即可
註:比起於phpize方式安裝,pecl方式安裝較為簡便,可省去手動新增至php.ini的環節
相關文章推薦:#
1.PECL方式安裝php-mongodb擴充步驟詳解
2.用於開發PECL擴充功能的PHP庫(下載)
相關視頻推薦:
1.獨孤九賤(4)_PHP影片教學
以上是詳解php透過pecl方式安裝擴展的詳細內容。更多資訊請關注PHP中文網其他相關文章!