I heard that you use swoole very much. Does swoole currently support windows?

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, but this extension cannot be used in windows systems.

Cygwin is a UNIX-like simulation environment that runs on the windows platform. "Since it is a simulation environment, it is easy to handle! Next we officially start to talk about how to build a swoole environment.

1. Download Swoole and Cygwin

Insert picture description here

Download Cygwin, mine is 64-bit

Insert picture description here

Two 1 install Cygwin

Insert picture description here

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, click One step button to start the installation.

(Note: The screenshot below is the interface after my installation. The clicked location is the same, but the icons behind may be different)

Search gcc first

Insert picture description here

Then php

Insert picture description here

Here is pcre-devel

Insert picture description here

Finally autoconf

Insert picture description here

Finally, the next step is to install.

Insert picture description here

2 Install Swoole

Unzip the source program of swoole to Cygwin's home directory, and open the Cygwin software (Note: If your Cygwin is also installed on the C drive, then you have to pay attention. There may be an error when installing swoole. The solution is to right-click and open Cygwin as an administrator )

Insert picture description here

1 The environment at this time is like a linux terminal, and the root directory is the installation directory of Cygwin. Enter the command in the interface: cd /home/swoole-src, where swool-src is the decompressed source program

Insert picture description here

2 The environment at this time is like a Linux terminal, and the root directory is the installation directory of Cygwin. Enter the command on the interface: cd /home/swoole-src, where swool-src is the decompressed source program

Insert picture description here

3Enter the command: phpize to generate the compiled configuration file configure

Insert picture description here

4输入命令:./configure && make && make install

Insert picture description here

Configure, compile, compile and install swoole

(PS: Execute ./configure, in addition to compiling configuration, it will also check the environment, etc.)

5 Use the command: php -i | grep php.ini, find the path of the configuration file php.ini used by php cli, modify the php.ini file, add a line in the file: extension=swoole.so, then close and exit

Insert picture description here

6 /extension search Press n to search again

Insert picture description here

7 Add extension=swoole.so

Insert picture description here

8 :wq save and exit

9 Use the command: php -m to view the loaded modules. If you see swoole, the extension is added successfully and the environment is successfully built!

Insert picture description here

Pay attention, don't get lost

Alright, everyone, the above is the entire content of this article. The people who can see here are all talents . As I said before, there are many technical points in PHP, because there are too many, it is really impossible to write, and you will not read too much after writing it, so I will organize it into PDF and documents here, if necessary Can

Click to enter the secret code: PHP+「Platform」

Insert picture description here

Insert picture description here


For more learning content, you can visit the [Comparative Standard Factory] Catalogue of Excellent PHP Architect Tutorials, as long as you can read it to ensure that the salary will rise a step (continuous update)

The above content hopes to help you . Many PHPers always encounter some problems and bottlenecks when they are advanced. There is no sense of direction when writing too much business code. I don’t know where to start to improve. I have compiled some information about this, 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 scripts, Docker, microservices, Nginx, etc. Multiple knowledge points, advanced advanced dry goods, can be shared with everyone for free, and those needed can join my PHP technology exchange group

Guess you like

Origin blog.csdn.net/weixin_49163826/article/details/108740225