編程學習網 > PHP技術 > swoole > 安裝swoole經驗分享
2021
07-20

安裝swoole經驗分享

swoole一定程度彌補了php在unix系統編譯問題上的不足,以下介紹一下swoole的安裝經驗

工具:升級PHP系統為7.0以上版本,gcc 4.8以及以上版本,make,autoconf,pcre(CentOS系統可以執行命令:yum install pcre-devel)

步驟:

安裝git:yum –y install git

圖片是已經安裝過的git

swoole的安裝


克隆swoole源碼:git clone …

地址:

https://github.com/swoole/swoole-src/releases

http://pecl.php.net/package/swoole

http://git.oschina.net/swoole/swoole

以http://git.oschina.net/swoole/swoole為例子,復制地址https://gitee.com/swoole/swoole.git

執行git clone https://gitee.com/swoole/swoole.git

swoole的安裝


執行編譯以下命令

cd swoole

phpize (ubuntu 沒有安裝phpize可執行命令:sudo apt-get install php-dev來安裝phpize)

./configure

make 

sudo make install

(圖片示例了兩條命令)

swoole的安裝


安裝pecl:yum install php-devel php-pear




執行一鍵安裝:pecl install swoole


配置php.ini


查找php.ini文件:find / -name "php.ini"

編譯安裝成功后:extension=swoole.so


swoole的安裝


查看swoole是否安裝成功:php –m


若看到swoole,即為安裝成功


以上就是“安裝swoole經驗分享”的詳細內容,想要了解更多swoole教程歡迎關注編程學習網


掃碼二維碼 獲取免費視頻學習資料

Python編程學習

查 看2022高級編程視頻教程免費獲取