从PHP 7.3更新到PHP 7.4.8之后,我注意到服务器已开始为所有请求记录“接受”,“关闭”,有时:“关闭而未发送请求;这可能只是未使用的推测预连接”。
[Wed Aug 5 17:51:27 2020] PHP 7.4.8 Development Server (http://localhost:3000) started
[Wed Aug 5 17:51:37 2020] 127.0.0.1:37788 Accepted
[Wed Aug 5 17:51:37 2020] 127.0.0.1:37792 Accepted
[Wed Aug 5 17:51:37 2020] 127.0.0.1:37788 [200]: (null) /
[Wed Aug 5 17:51:37 2020] 127.0.0.1:37788 Closing
[Wed Aug 5 17:52:02 2020] 127.0.0.1:37808 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed Aug 5 17:52:02 2020] 127.0.0.1:37808 Closing
我想知道是否存在以“静默”模式启动服务器的选项,该模式下日志仅包含信息,警告和错误。
答案 0 :(得分:0)
如果您自己启动 PHP 服务器,向它传递 -q
或 --no-header
参数(安静模式)为我解决了这个问题:
php -q -S 127.0.0.1:8080 index.php