Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

satanik's avatar

Post install scripts always timeout

I started a new project with Laravel Version 5.7.7. The problem I face now is that the scripts run by composer like php artisan package:discover always timeout. When I remove the timeout it just doesn't end. This is not limited to this console command, it also happens with all the others like ide-helper:generateetc. So for now the only solution for me is to run all the composer commands with --no-scripts and call the scripts manually afterwards in the terminal, which works normal.

I will output what is shown at the end when calling composer update -vvv to see that the command that fails is the command that calls the script:

Resolving dependencies through SAT
Looking at all rules.
Something's changed, looking at all rules again (pass #4)
Dependency resolution completed in 1.738 seconds
Analyzed 17823 packages to resolve dependencies
Analyzed 1048932 rules to resolve dependencies
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Package operations: 0 installs, 0 updates, 0 removals
Reading /Users/user/Sites/laravel/project/vendor/composer/installed.json
Reading ./composer.lock
Generating optimized autoload files
> post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
> post-autoload-dump: @php artisan package:discover
Executing command (CWD): '/usr/local/Cellar/php/7.2.7/bin/php' -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='1536M' artisan package:discover

                                                                                                                                                                                            
  [Symfony\Component\Process\Exception\ProcessTimedOutException]                                                                                                                            
  The process "'/usr/local/Cellar/php/7.2.7/bin/php' -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='1536M' artisan package:discover" exceeded the timeout of 300 seconds.  
                                                                                                                                                                                            

Exception trace:
 () at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/process/Process.php:1193
 Symfony\Component\Process\Process->checkTimeout() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/process/Process.php:356
 Symfony\Component\Process\Process->wait() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/process/Process.php:198
 Symfony\Component\Process\Process->run() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Util/ProcessExecutor.php:68
 Composer\Util\ProcessExecutor->execute() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:245
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:96
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:312
 Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Installer.php:303
 Composer\Installer->run() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Command/UpdateCommand.php:162
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Console/Application.php:254
 Composer\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/src/Composer/Console/Application.php:103
 Composer\Console\Application->run() at phar:///usr/local/Cellar/composer/1.6.5/bin/composer/bin/composer:56
 require() at /usr/local/Cellar/composer/1.6.5/bin/composer:24

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...
0 likes
0 replies

Please or to participate in this conversation.