怎么在php中利用pecl方式安裝擴(kuò)展?相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。
1、安裝pecl及創(chuàng)建快捷鍵
# 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、查詢是否已經(jīng)收錄了該擴(kuò)展
# pecl search swoole // swoole為要查詢擴(kuò)展名(以swoole擴(kuò)展為例) //查詢結(jié)果: 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、安裝配置擴(kuò)展
# pecl install swoole //輸出結(jié)果: 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即可
看完上述內(nèi)容,你們掌握怎么在php中利用pecl方式安裝擴(kuò)展的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!