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

Ahmed96's avatar
Level 13

laravel ffmpeg upload video in amazon s3 failed 504 gateway Time-out the server didn t respond in time

Why after uploading a video size of more than 1 Giga, I see a problem in the nginx 504 gateway timeout preventing me from completing the processing process. The meaning of the video after uploading starts the processing process and because of this problem it does not go to processing use laravel ffmpeg and use amazon s3 service to store the videos on it and the entire site uploaded to Digital hosting

0 likes
6 replies
artcore's avatar

Marhaba. Uploading is done via PHP which has a timeout of 30 secs default?

Google "laravel chunk upload" and "resumable js". There are many packages for it.

Ahmed96's avatar
Level 13

Sure, loading and processing is done on php, as well as nginx, so what commands that I add to php and nginx will increase the connection timeout?

artcore's avatar

When an upload takes more than the php timeout I think it will die. Also assume uploading a 10GB file takes 1 hour, without resumable pieces your client is screwed if it fails before it's fully uploaded. Plus you don't have to worry about the max_upload_size.

Ahmed96's avatar
Level 13

Exactly, but how do I increase the timeout for php, which makes me able to raise 10 gigabytes per hour or more without any connection to the server being interrupted? What should I add?

artcore's avatar

@ahmed96 Don't raise the php timeout, just make a fresh call to your controller for each chunk by chunking the requested file.

See http://www.resumablejs.com/ You can then merge all chunks into 1 file after all are in.

Ahmed96's avatar
Level 13

OK, I'll see the package Thank you

Please or to participate in this conversation.