Preparation: After installing php, also need to add the PHP executable directory to the environment variable.
// Open the file vi ~ / .bashrc
// add these two lines at the end of the file, save and exit Export the PATH = / usr / local / PHP / bin: $ the PATH Export the PATH = / usr / local / PHP / sbin: $ the PATH / / enter the command Source ~ / .bashrc // check the version of php -version
Swoole installation Address: https://github.com/swoole/swoole-src/releases
In the / usr / local / src storage installation package
wget -O Swoole-4.4.5.tar.gz https://github.com/swoole/swoole-src/archive/v4.4.5.tar.gz
tar -zxvf Swoole-4.4.5.tar.gz
cp swoole-src-4.4.5 /usr/local/swoole -r
cd /usr/local/swoole/
//phpize的路径为/usr/local/php/bin/,生成configure文件
/usr/local/php/bin/phpize
./configure
sudo make
sudo make install
// find files /usr/local/php/php.ini
vi the php.ini
// add this line, save and exit
extension = swoole.so
// copy on php / etc
cp /usr/local/php/php.ini / usr / local / php / etc / // restart
php-FPM Service php_fpm restart
// Check expansion module, see swoole success
php -m