Home >PHP Framework >Swoole >How to install swoole under windows
Specific steps to install swoole under Windows:
The swoole framework is a very magical and powerful framework, which makes up for some of the shortcomings of PHP itself. In fact, swoole is a PHP extension written in C language, and this extension cannot be used on Windows systems, but in terms of the current development environment, more programmers still use Windows. So how can we develop and use swoole extension in Windows system?
Of course we can use vm to make a virtual machine and then build a Linux environment, but in this case we can only write the code in the virtual machine or copy it to the virtual machine after writing it in windows! For me, I thought it was too troublesome, so I asked Du Niang and found out about cgywin. I quoted the introduction on Baidu Encyclopedia "Cygwin is a UNIX-like simulation environment running on the Windows platform." Since it is a simulation environment, then Easy to handle! Next, we will officially start talking about how to build a swoole environment
First download
cgywin Address: http://www.cygwin.com/. Note here that you need to download the correct version
swoole Address: https://github.com/swoole/swoole-src/releases Download 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 picture. I chose this one but you may not be sure about it when you use it. But don’t worry. Anyway, there are so many provided and one of them will definitely be usable
Next, you need to choose the pre-installed software. Since you want to run the php environment, you need to install a few software
gcc
php, here It should be noted that you should choose two when installing php, that is, do not throw away the php-devel extension, otherwise you will be in trouble when you use phpize to compile it later! ! ! !
pcre-devel
autoconf
Okay! Just take the next step! This will be a long process
Install the swoole extension
We will unzip the swoole we just downloaded into the home folder in the installation directory of cgywin (Students who have used Linux systems are not excited to see the folders in the installation directory. Yes, they look familiar!!!), then open the cgywin software and enter the swoole directory
Then compile ./configure && make && make install
##After executing this command, it means installing the swoole extension Basically successful, then just introduce the extension! The php.ini file is usually found under the etc folder. You can also use php -i | grep php.ini to view Write extension=swoole in the php.ini file .so Save the file. Execute php -m to see ifhas been loaded
The above is the detailed content of How to install swoole under windows. For more information, please follow other related articles on the PHP Chinese website!