How to install swoole under windows system

The swoole framework is a very amazing and powerful framework, which makes up for some of the shortcomings of PHP itself. In fact, swoole is exactly a PHP extension written in C language, and this extension cannot be used in the windows system, but as far as the current development environment is concerned, there are still many programmers who use windows. So how can we develop and use swoole extensions in the windows system? Of course, we can use vm to be a virtual machine and then build a linux environment, but to do so, we can only write code in the virtual machine or copy it to the virtual machine after the windows are written! For me, I thought it was too much trouble, so I asked Du Niang and found out about cgywin, citing the introduction on Baidu Encyclopedia "Cygwin is a UNIX-like simulation environment running on the windows platform", since it is a simulation environment, then Good job! Next, we will officially start talking about how to build a swoole environment

Download first 

cgywin address: http://www.cygwin.com/. Note here to download the correct version

swoole address: https://github.com/swoole/swoole-src/releases Download the tar.gz version

install cgywin

 

Click Next

Continue to click next

 

The above installation directory and download directory are set by yourself. The next step is to select the mirror address as shown in the figure. I chose this one, but it may be uncertain when you use it, but don’t worry, anyway, there are so many provided, and one of them will definitely be available.

Next, you need to choose the pre-installed software. Since you want to run the PHP environment, you need to install several software.

gcc

 

php, here you need to pay attention to choose two when installing php, that is, don't throw away the php-devel extension, or you will know the trouble when you compile it with phpize later! ! ! !

pcre-devel

 

autoconf

Okay! The next step is just fine! it will be a long process

Wait and wait. . . . . . . . until done! ! !

Install the swoole extension

We unzip the swoole we just downloaded to the home folder in the installation directory of cgywin (students who have used the linux system are excited to see the folders in the installation directory, they are familiar with each other!!!), Then open the cgywin software and enter the swoole directory

Then execute phpize (declare here that if you did not install php-devel when you chose to install php, you will be reminded that you do not have this command)

Then compile ./configure && make && make install

After executing the command, it means that the installation of the swoole extension is basically successful. Next, you can introduce the extension! Find the php.ini file generally under the etc folder, you can also use php -i | grep php.ini to view

Write extension= swoole.so in the php.ini file to   save the file. Execute php -m to see if it has been loaded

This is all over!!

 

For more content, follow the public account "Uncle Ape"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325383030&siteId=291194637
Recommended