Install swoole in Windows (php) and swoolephp
To install swoole in Windows, follow these steps:
Swoole, originally not supported in Windows, so we need to install Cygwin for use. I encountered a lot of pitfalls when installing Cygwin, and the documents on Baidu experience were not very comprehensive. So I wrote down Cygwin and Swoole on my own, which is equivalent to accumulating my own resources.
First, prepare the tool:
Cygwin official address: http://www.cygwin.com/
Official: https://github.com/swoole/swoole-src/releases swoole
I. Download Swoole and Cygwin
Download Cygwin, Which is 64-bit
2. Install Cygwin
Select the software package to be installed. Install gcc, PHP, php development tools, autoconf, and pcre-devel. By default, note that after searching in the search box above, select the corresponding software package and click Next to start installation. (Note: The following figure shows the UI after I install it. The position is the same, and the icon on the back may be different)
Search for gcc first
Then php
Where pcre-devel
Finally, autoconf
The next step is the installation.
2. Install Swoole and decompress the swoole source program to the Home Directory of Cygwin. Open the Cygwin software (Note: if your Cygwin is also installed on the C drive, you must pay attention to it, when swoole is installed, an error may be reported. The solution is to right-click Cygwin as the administrator. 1. The environment is like a linux terminal, and the root directory is the installation directory of Cygwin, enter the command cd/home/swoole-src on the interface. swool-src is the decompressed source program. 2. The environment is like a linux terminal, and the root directory is the installation directory of Cygwin, enter the command cd/home/swoole-src on the interface. swool-src is the decompressed source program. 3. Enter the command phpize to generate the compiled configuration file configure4. Enter the command :. /configure & make install
Configure, compile, compile, and install swoole
(PS: Execute./configure. In addition to compiling configurations, it also checks the environment and so on)
5. Run the following command: php-I | grep php. ini, find the configuration file php. ini path, modify php. INI file, add a line in the file: extension = swoole. so, and then close and exit
6. Search extension by n.
7 add extension = swoole. so
8: wq save and exit
9 run the php-m command to check the loaded modules. If swoole is displayed, the extension is added successfully and the environment is successfully established!