我正在使用 PHP 内置的服务器,如下所示:
$ composer serve
> php -S localhost:8000 -t public/
但是它超时了..?
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "php -S localhost:8080 -t public/" exceeded the timeout of 300 seconds.
所以,我试图重新启动它:
$ composer serve
> php -S localhost:8000 -t public/
[Thu May 26 21:31:51 2016] Failed to listen on localhost:8000 (reason: Address already in use)
Script php -S localhost:8000 -t public/ handling the serve event returned with error code 1
为什么服务器在超时之前运行的同一端口仍在使用中?我可以停止服务器内置的所有 PHP 实例吗?
如果重要的话,下面是我的 composer.json 文件:
{
.
.
.
"scripts": {
"serve": "php -S localhost:8000 -t public/"
}
}