• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue (Urgent) Can't download files >1GB served by PHP

massimo

New Pleskian
Hi everyone,
I am facing a quite urgent issue here, because all the downloads of files >1GB served by PHP via HTTP are failing exactly at 1GB.
I've searched online but nothing seems to solve the issue.

Can anybody help?

Massimo.
 
This will probably need some extra web server configurations. I suggest to start with an Nginx directive in "Additional Apache and Nginx directives"

proxy_max_temp_file_size <desired size>

for example

proxy_max_temp_file_size 4096m
to allow files up to 4 GB to be delivered by Nginx.
 
This will probably need some extra web server configurations. I suggest to start with an Nginx directive in "Additional Apache and Nginx directives"

proxy_max_temp_file_size <desired size>

for example

proxy_max_temp_file_size 4096m
to allow files up to 4 GB to be delivered by Nginx.
Thanks, did try that earlier, didn't solve. Should "Serve static files directly by nginx" be enabled as well?
 
Before you spend hours over hours figuring out what file this is, from what server it is actually served, what configuration must be done to make this work: Can't you just simply download it via FTP? Just asking, because web servers are just not made to deliver "pages" or other resources like files that are so extremely big.

Else, if you absolutely want your web server to deliver very large files, you will need to check Google for all the directives that this needs. There can be issues in PHP, in Apache and in Nginx. It can be issues with the maximum allowed block size, maximum allowed file size, the RAM that this operation needs, the timeout values in PHP (e.g. the script run time must not expire before a script has completed content delivery) etc. Simply walk through all parts involved to find a solution. I doubt that it will be possible to go through all these different aspects online in a forum.
 
Before you spend hours over hours figuring out what file this is, from what server it is actually served, what configuration must be done to make this work: Can't you just simply download it via FTP? Just asking, because web servers are just not made to deliver "pages" or other resources like files that are so extremely big.

Else, if you absolutely want your web server to deliver very large files, you will need to check Google for all the directives that this needs. There can be issues in PHP, in Apache and in Nginx. It can be issues with the maximum allowed block size, maximum allowed file size, the RAM that this operation needs, the timeout values in PHP (e.g. the script run time must not expire before a script has completed content delivery) etc. Simply walk through all parts involved to find a solution. I doubt that it will be possible to go through all these different aspects online in a forum.
Thanks Peter.
Nginx's client_max_body_size is already set to 2000m (since my site handles large file uploads).

Anyways it seems to be solved after I set this PHP directive in php.ini:
output_buffering = 0 (instead of 4096)
Does it make sense to you?

Anyways my PHP download script is already handling streamed download so I don't really understand where's the issue with big files.
(I am using Laravel framework: File Storage - Laravel - The PHP Framework For Web Artisans)

I might as well try using FTP and see if that's gonna work better.

Thanks for your kind reply and help!

Best,
Massimo.
 
Back
Top