duanju8308 2016-05-26 12:37
浏览 193
已采纳

当PHP内置服务器崩溃时,该端口仍在使用中

I'm using PHP built in server like so:

$ composer serve
> php -S localhost:8000 -t public/

But it timed out..?

[Symfony\Component\Process\Exception\ProcessTimedOutException]                     
  The process "php -S localhost:8080 -t public/" exceeded the timeout of 300 seconds.

So, I tried to start it up again:

$ 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

Why is the same port that the server was running on prior to timing out still in use? Can I stop all instances of PHP built in server?

If it matters, below is my composer.json file:

{
    .
    .
    .
    "scripts": {
        "serve": "php -S localhost:8000 -t public/"
    }
}
  • 写回答

2条回答 默认 最新

  • dongzong2017 2016-05-26 13:01
    关注

    The problem is that composer has a default timeout after 300 seconds.

    When executing the command you can use --timeout=0, this disables the timeout. In your example the command would look like composer run-script server --timeout=0

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python