在PhpStrom中配置Docker作为本地开发环境
准备镜像
docker pull phpswoole/swoole
配置php解释器

创建测试文件
#!/usr/bin/env php <?php declare(strict_types=1); use Swoole\Http\Request; use Swoole\Http\Response; use Swoole\Http\Server; $http = new Server("0.0.0.0", 9501); $http->on( "start", function (Server $http) { echo "Swoole HTTP server is started.\n"; } ); $http->on( "request", function (Request $request, Response $response) { $response->end("Hello, World!\n"); } ); $http->start();
选择刚才配置的解释器运行


浙公网安备 33010602011771号