Troubleshooting 504 Gateway Timed Out” Errors

504 errors indicate that the request timed out. If you get one while updating Craft, it probably means that the Craft update process took longer than your web server is configured to allow PHP scripts to run (usually 30 seconds).

Craft tries to prevent these errors by calling set_time_limit(0);, but that’s not always reliable due to conflicting Apache/Nginx configuration settings, or because PHP is being run through FastCGI.

If you’re getting 504 error when updating Craft, you can try setting the backupOnUpdate config setting to false, and start backing up manually instead.

If you’re still having trouble, try contacting your host and see if there’s anything you can do to increase your server’s allowed execution time.

Applies to Craft CMS 3.