You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel Envoyer部署钩子安装Composer依赖超时求助

Fixing Envoyer's "Install Composer Dependencies" 600s Timeout Issue

Hey there, I’ve run into this exact problem a few times with Envoyer and Laravel deployments—nothing’s more annoying than a deployment grinding to a halt because Composer can’t finish in time. Let’s go through the most effective fixes, since adjusting process-timeout in composer.json often doesn’t cut it here:

1. Adjust the Envoyer Hook’s Own Timeout

The most likely culprit is Envoyer’s built-in timeout for individual deployment hooks, which defaults to 600 seconds. This overrides any Composer-level timeout settings you’ve set. Here’s how to change it:

  • Log into your Envoyer dashboard and navigate to your project.
  • Go to the Deployment Hooks section.
  • Find the "Install Composer Dependencies" hook, click the edit icon (pencil).
  • Look for the Timeout field (it’s usually near the bottom of the edit form).
  • Increase it to a higher value like 1200 (20 minutes) or whatever makes sense for your dependency load.
  • Save the hook and trigger a new deployment.

2. Optimize Composer Install to Reduce Runtime

Instead of just extending timeouts, let’s make Composer run faster so it doesn’t hit the limit in the first place. Modify the Composer command in your Envoyer hook to include these flags:

composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction
  • --no-dev: Skips dev dependencies (perfect for production deployments)
  • --prefer-dist: Downloads pre-built archives instead of cloning repos, which speeds up installs drastically
  • --optimize-autoloader: Generates a more efficient autoloader (adds a small upfront cost but boosts app performance later)
  • --no-interaction: Prevents Composer from asking interactive questions that could stall the process

Also, enable Composer Cache in Envoyer:

  • Go to your project’s Settings tab.
  • Toggle on the Composer Cache option. This caches downloaded dependencies between deployments, cutting down repeated install times significantly.

3. Verify Server-Side PHP Timeout Settings

Even if Envoyer allows a longer timeout, your server’s PHP configuration might be cutting the process short. Check these values on the problematic server:

  • SSH into the server and run php -i | grep max_execution_time to see the current limit.
  • If it’s set to a value lower than your Envoyer hook timeout, edit your php.ini file (location varies by server, e.g., /etc/php/8.2/cli/php.ini for PHP 8.2 CLI) and set max_execution_time = 1200 (or 0 for no limit).
  • Restart your PHP-FPM service (if applicable) or start a new SSH session to apply the change.

4. Test Composer Manually on the Server

Sometimes the issue is specific to the server’s environment (slow network, permission issues, or a problematic dependency). SSH into the server, navigate to your project’s deployment directory, and run the Composer command manually:

composer install

Watch the output—if it hangs on a specific package, you might need to troubleshoot that dependency (e.g., switch to a faster mirror, or check if the package repo is accessible from the server).

Hopefully one of these fixes gets your deployments back on track!

内容的提问来源于stack exchange,提问作者wp-developer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:48:59