准备镜像
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();
选择刚才配置的解释器运行
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/272726.html