1、安裝git:yum –y install git
圖片是已經(jīng)安裝過的git
2、克隆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為例子,復(fù)制地址https://gitee.com/swoole/swoole.git
執(zhí)行
git clone https://gitee.com/swoole/swoole.git
3、執(zhí)行編譯以下命令
cd swoole
phpize (ubuntu 沒有安裝phpize可執(zhí)行命令:sudo apt-get install php-dev來安裝phpize)
./configure
make
sudo make install
(圖片示例了兩條命令)
4、安裝pecl:yum install php-devel php-pear執(zhí)行一鍵安裝:pecl install swoole
5、配置php.ini
查找php.ini文件:find / -name "php.ini"
編譯安裝成功后:extension=swoole.so
6、查看swoole是否安裝成功:php –m
若看到swoole,即為安裝成功
推薦學(xué)習(xí): swoole視頻教程