下面小編就為大家分享一篇php透過pecl方式安裝擴充的實例講解,具有很好的參考和學習PHP的價值,希望對大家有所幫助。對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的環節
相關推薦:
#透過 pecl 快速安裝 php-memcached 擴充功能
以上是php透過pecl方式安裝擴充的實例講解的詳細內容。更多資訊請關注PHP中文網其他相關文章!