CentOS Installation Swoole

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.