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源碼: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

執行編譯以下命令
cd swoole
phpize (ubuntu 沒有安裝phpize可執行命令:sudo apt-get install php-dev來安裝phpize)
./configure
make
sudo make install
(圖片示例了兩條命令)
安裝pecl:yum install php-devel php-pear
執行一鍵安裝:pecl install swoole
配置php.ini
查找php.ini文件:find / -name "php.ini"
編譯安裝成功后:extension=swoole.so
查看swoole是否安裝成功:php –m
若看到swoole,即為安裝成功
以上就是“安裝swoole經驗分享”的詳細內容,想要了解更多swoole教程歡迎關注編程學習網
掃碼二維碼 獲取免費視頻學習資料
- 本文固定鏈接: http://www.wangchenghua.com/post/8321/
- 轉載請注明:轉載必須在正文中標注并保留原文鏈接
- 掃碼: 掃上方二維碼獲取免費視頻資料