Specific steps to install swoole under Windows:
Swoole does not originally support installation under Windows, so we need to install Cygwin to use it. I encountered a lot of pitfalls when installing Cygwin, and the documentation on Baidu's experience is not very complete, so I wrote down my own installation of Cygwin and Swoole, which is equivalent to my own precipitation.
First prepare the tools:
Cygwin official address:
swoole official download address:
One. Download Swoole and Cygwin
![](https://img.php.cn/upload/article/000/000/001/84c4dfa5e99a8835cb81e0e017aeab23-0.png)
##Download Cygwin, mine is 64-bit
![](https://img.php.cn/upload/article/000/000/001/84c4dfa5e99a8835cb81e0e017aeab23-1.png)
2 1Install Cygwin
![](https://img.php.cn/upload/article/000/000/001/cf41d352e0429d06ef5bf43d6be44801-2.png)
Select the software package to install. Here you need to install gcc, PHP, php development tools, autoconf, pcre-devel, and other defaults. Note here that after searching in the search bar above, find the corresponding software package below and select it, and click the Next button to start the installation. (Note: The screenshot below is the interface after I installed it. The click position is the same, but the icons behind it may be different)
First search for gcc
![](https://img.php.cn/upload/article/000/000/001/cf41d352e0429d06ef5bf43d6be44801-3.png)
Then php
![](https://img.php.cn/upload/article/000/000/001/cf41d352e0429d06ef5bf43d6be44801-4.png)
is pcre-devel
![](https://img.php.cn/upload/article/000/000/001/cf41d352e0429d06ef5bf43d6be44801-5.png)
##Finally autoconf
![](https://img.php.cn/upload/article/000/000/001/ab700bddef53c24409b5d512df02ae8c-6.png)
Finally, just go to the next step to install it.
![](https://img.php.cn/upload/article/000/000/001/ab700bddef53c24409b5d512df02ae8c-7.png)
2 Install Swoole
Extract the swoole source program to the Cygwin home directory and open the Cygwin software (Note: If your Cygwin is also installed on the C drive, then you have to pay attention. An error may be reported when installing swoole. The solution is to right-click and open Cygwin as administrator)
1 The environment at this time is like a Linux terminal, and the root directory is the Cygwin installation directory. Enter the command in the interface: cd /home/swoole-src, where swool-src is the decompressed source program
2The environment at this time is like a Linux terminal, and the root directory is the Cygwin installation directory. Enter the command in the interface: cd /home/ swoole-src, where swoole-src is the decompressed source program
3 Enter the command: phpize to generate the compiled configuration file configure
![](https://img.php.cn/upload/article/000/000/001/7c552d9c93f97b188efb2c2b8904e5dd-11.png)
4 Enter the command: ./configure && make && make install
![](https://img.php.cn/upload/article/000/000/001/7c552d9c93f97b188efb2c2b8904e5dd-12.png)
##Configure, compile, compile and install swoole
(PS: Execute ./configure, in addition to compiling the configuration, it will also detect the environment, etc.)
5 Use the command: php -i | grep php.ini to find php The path to the configuration file php.ini used by cli, modify the php.ini file, add a line in the file: extension=swoole.so, then close and exit
##6 /extension Search Press n to search again
7 Add extension=swoole.so
8 :wq Save and exit
9 Use the command: php -m to view the loaded module. If you see swoole, the extension is added successfully. The environment has been set up successfully!
![](https://img.php.cn/upload/article/000/000/001/273e6e5d6ae106a26cbae6c297c5c68c-16.png)
The above is the detailed content of What are the steps to install swoole under Windows?. For more information, please follow other related articles on the PHP Chinese website!