在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();
选择刚才配置的解释器运行
标签:function,http,request,PhpStrom,start,本地,Docker,php,response 来源: https://www.cnblogs.com/root0/p/16366245.html