PECL
The swoole project has been included in the official PHP extension library. In addition to downloading and compiling manually, you can also download and install swoole with one click through the pecl command provided by PHP.
pecl install swoole
If you can't run the pecl command, you can use the php path plus bin/pecl to run it
configure php.ini
After successful compilation and installation, modify php.ini to add
extension=swoole.so
Use php -m or phpinfo() to check whether swoole is successfully loaded. If there is no possibility that the path of php.ini is wrong, you can use php -i |grep php.ini to locate the absolute path of php.ini.