The Swoole framework is an amazing framework that makes up for some of the shortcomings of PHP itself. Swoole is actually a PHP extension written in C, but it doesn’t work on Windows.

Cygwin is a Unix-like emulation running on Windows. So let’s start talking about how do you set up a swoole environment

Download Swoole and Cygwin

Download Cygwin, mine is 64-bit

21 Install Cygwin

GCC, PHP, PHP development tool, autoconf, pcl-devel, and other default packages are required. Note: After searching in the upper search bar, find the corresponding software package and click the next button to start installation.

(Note: the screenshot below is the interface after I installed it. The position of clicking is the same, but the ICONS behind may be different.)

First, search GCC

Then the PHP

In is pcre – devel

The last autoconf

Finally go to the next installation.

2 install Swoole

Unzip swoole’s source to Cygwin’s home directory and open the Cygwin software. (Note: If you have Cygwin installed on drive C, you may receive an error while installing Swoole. The solution is to right-click the administrator and open Cygwin.)

1 At this time, the environment is like the terminal of Linux, and the root directory is the installation directory of Cygwin. Enter the command CD /home/swoole-src on the interface, where swool- SRC is the source program of decompression

2 at this time, the environment is like the terminal of Linux, and the root directory is the installation directory of Cygwin. Enter the command CD /home/swoole-src on the interface, where swool- SRC is the source program of decompression

3 Run the phpize command to generate the configured file

4 Run the./configure && make && make install command

Configure, compile, compile and install Swoole

(PS: execute./configure, check the environment, etc.)

5 using the command: PHP – I | grep PHP. Ini, find the PHP cli using PHP configuration file. The path of the ini, modify the PHP. The ini file and add a line in the file: extension = swoole. So, then close out

Press n to search again

7 to add the extension = swoole. So

8 :wq Save the configuration and exit

9 use the command: PHP -m to view the loaded module. If you see swoole, the extension is added successfully and the environment is set up successfully!

Pay attention and don’t get lost

All right, everybody, that’s all for this article. All the people here are talented. As I said before, there are many technical points in PHP, because there are too many, it is really difficult to write, you will not read too much after writing, so I have compiled it into PDF and document, if necessary

Click on the code: PHP+ “platform”

As long as you can guarantee your salary to rise a step (constantly updated)

I hope the above content can help you. Many PHPer will encounter some problems and bottlenecks when they are advanced, and they have no sense of direction when writing too many business codes. I have sorted out some information, including but not limited to: Distributed architecture, high scalability, high performance, high concurrency, server performance tuning, TP6, Laravel, YII2, Redis, Swoole, Swoft, Kafka, Mysql optimization, shell scripting, Docker, microservices, Nginx, etc