Install swoole extension and php7swoole extension in php7

Source: Internet
Author: User

Install swoole extension and php7swoole extension in php7

I accidentally saw a video tutorial about live broadcast yesterday.

Swoole is mentioned in this article. I believe everyone has heard of this thing (phper for nearly a year), but I have not actually used it, and of course I do not know how to use it (me too ).

Here we will summarize how to install the swoole extension in php7 (drawing on several online technical posts.

My Environment

CentOS Linux release 7.3.1611 (Core)
PHP 7.0.22 (cli) (built: Aug 9 2017 18:23:24) (ETS)
Mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1

Nginx version: nginx/1.10.2

Installation Steps

1. wget-c https://github.com/swoole/swoole-src/archive/v2.0.8.tar.gz // The latest version 2.0.8

2. tar-zxvf v2.0.8.tar.gz // decompress the package and then cd to the compressed directory.

3. At this time, you need to use phpize to generate the compilation file (here we have attached http://www.cnblogs.com/hubing/p/4941692.html's explanation of phpizeis clear ){

The role of phpize can be understood as follows: Detection Environment (the phpize tool is in the php installation directory, based on which phpize corresponds to the current php environment, generate the corresponding configure file based on the php configuration) and create a configure file. You must run phpize in a directory. Then phpize will know which directory your environment is, And the configure file is created under this directory.

}

At this time, I am saving The following error: Can't find PHP headers in/usr/include/php The php-devel package is required for use of this command.

Solution: yum install php70w-devel

4. Run phpize/usr/bin/phpize (remember to run it in the swoole extension directory)

5. Execute./configure

6. make & make install

7. Modify php. ini to add extension = swoole. so.

8. Remember to restart the service.

 

OK! Execute php-m and you will see swoole added.

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.