This article brings you the relevant implementation steps for swoole-cli to support the Windows environment. The latest swoole-cli supports the Windows environment and is based on cygwin64. You can download it and use it. I hope it will be helpful to everyone.
Recommended learning: swoole video tutorial
The latest swoole-cli supports Windows environment and is implemented based on cygwin64. Download and use.
A newly installed Windows
machine (must be a 64
-bit system) does not need to install any php
related Software package, you can directly download the executable program zip
compressed package of swoole-cli-cygwin64
, and then unzip it to any directory.
swoole-cli is installation-free and can be used directly
Download address: https://github.com/swoole/swoole-src/releases /download/v4.8.7/swoole-cli-v4.8.7-cygwin64.zip
swoole-cli will be released simultaneously with swoole. You can download the latest version of swoole from the github release page -cli
, you first need to configure the decompressed folder/bin directory into the system's Path environment variable.
Use win r to enter cmd to enter the Windows command line. You can use the swoole-cli command to execute the swoole or php program.
swoole-cli contains various commonly used extensions, the list is as follows:
If you want to add extensions To swoole-cli, you can submit an issue on the official github homepage of swoole
The PHP version used by swoole-cli is 8.1.1
D:\>swoole-cli -m [PHP Modules] bcmath bz2 Core ctype curl date dom exif fileinfo filter gd gmp hash iconv imagick json libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_mysql pdo_sqlite Phar posix redis Reflection session SimpleXML soap sockets sodium SPL sqlite3 standard swoole tokenizer xml xmlreader xmlwriter xsl yaml zip zlib [Zend Modules]
Write the simplest Web service for testing. The file name is server.php:
<?php $http = new Swoole\Http\Server('127.0.0.1', 9501, SWOOLE_BASE); $http->on('start', function ($server) { echo "Swoole http server is started at http://127.0.0.1:9501\n"; }); $http->on('request', function ($request, $response) { $response->header('Content-Type', 'text/plain'); $response->end('Hello World'); }); $http->start();
Run:
Open the browser and enter http:// You can see the results at 127.0.0.1:9501/.
Recommended learning: swoole tutorial
The above is the detailed content of The latest swoole-cli can support Windows environment!. For more information, please follow other related articles on the PHP Chinese website!