1. First we want to install the swoole extension, we need to download its package, is:
Https://github.com/swoole/swoole-src
2. Unzip after downloading:
Unzip Swoole-src-master.zip
3. Unzip the unpacked directory after unpacking, I was extracted under the directory/opt, so
Cd/opt/swoole-src-master
4. Then recompile PHP with Phpize and execute the command:
/usr/bin/phpize
If you can't find the Phpize file, you can use the command to find it, preferably in the root directory, so it can start looking from the root directory:
Find-name phpize
If your system does not have Phpize installed, execute the command to install it, the instructions are:
Yum Install Php-devel
5. Then configure the command to:
./configure--with-php-config=/usr/bin/php-config
Because my php-config file is under/usr/bin/, so as long as you use your own php-config path on it, the others are consistent
6. After the configuration is done, compile the installation:
Make && make install
But there may be a problem in this step:
/usr/include/php/ext/pcre/php_pcre.h:29:18:error:pcre.h:no such file or directory
This error is caused by not installing pcre-devel, all as long as the installation is available
Yum Install Pcre-devel
7. After installation, a path is output, which is to generate the swoole.so file path, and then configure PHP.ini to configure the path:
Extension=/usr/lib/php/modules/swoole.so
8. Then restart the server
Service httpd Restart
CentOS Installation Swoole