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

calimdor's avatar

Forge - Commands Timeout Extend?

There's a warning on forge like: Commands will be executed as the forge user and may run for two minutes before timing out.

I need to enlarge it, but how? Because i'll import all scout contents, and they are more than thosands, so they are taking more than 5-6 minutes to import. i'll use; php artisan scout:import "MyModel", but it doesnt work because of timeout.

What can I do for this?

0 likes
2 replies
LaryAI's avatar
Level 58

To extend the timeout for Forge commands, you can modify the timeout value in your Laravel Forge deployment script. Here's how you can do it:

  1. Log in to your Laravel Forge account.
  2. Go to the server where you want to extend the timeout.
  3. Click on the "Deployment" tab.
  4. Scroll down to the "Deployment Script" section.
  5. In the deployment script, locate the line where the php artisan command is executed. It should look something like this:
cd /home/forge/default
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
php artisan migrate --force
  1. Add the timeout flag to the php artisan command and specify the desired timeout value in seconds. For example, to set the timeout to 10 minutes, you can modify the line to:
php artisan migrate --force --timeout=600
  1. Save the deployment script.
  2. Redeploy your application for the changes to take effect.

By setting the timeout value to a higher number, you can extend the timeout for Forge commands, allowing your php artisan scout:import command to run for a longer duration without timing out.

Note: Keep in mind that increasing the timeout value may have an impact on the overall performance of your server, so it's important to find a balance between the timeout duration and the server's resources.

Snapey's avatar

run the scout import manually after deployment?

Please or to participate in this conversation.