Why composer install timeouts after 300 seconds?

后端 未结 9 670
南笙
南笙 2020-12-02 08:15

I have small project made in symfony2 when I try to build it on my server it\'s always fails when unzipping symfony. Build was OK and suddenly composer won\'t unzip symfony

9条回答
  •  臣服心动
    2020-12-02 08:59

    The Symfony Component has process timeout set to 60 by default. That's why you get errors like this:

    [Symfony\Component\Process\Exception\ProcessTimedOutException]     
    The process "composer update" exceeded the timeout of 60 seconds. 
    

    Solution

    Set timeout to 5 minutes or more

    $process = new Process("composer update");
    $process->setTimeout(300); // 5 minutes
    $process->run();
    

提交回复
热议问题