0

I have a vps server (on hostinger) running on openlitespeed (cyberpanel). The website that I built uses PHP.

I created a file upload service and set my php config's post max limit to 1024M and upload max filesize to 1024M as well since both those settings work on my local when testing for large file uploads under 1gb. (I've also restarted php, as well as my server to see if it solved the issue but it still persists. I've also created a phpinfo file to confirm if my post max limit and upload max filesize were changed to 1024M/1G and they were changed)

But on my webserver, uploading files larger than 500mb gives me a "POST net::ERR_HTTP2_PROTOCOL_ERROR" on my console pointing to a line on one of my javascript code referring to my xhttp.send (specifically xhttp.send(formData) XML Http Request. This XML http request forwards the selected file to an upload.php script that processes the data. But it's not getting sent to that script due to the error.

When I get that error when uploading files larger than 500mb, I'd also get an error in my server's error log:

[NOTICE] [xxxx] [T0] [xx.xxx.xx.xxx:xxxxx:HTTP2-3#APVH_*:443_website.com] Request body size: <filesize> is too big!

The uploader works fine when uploading files under 500mb, it sends the formdata to the php upload script and stores it in the server as well as the database. But it gives an error when uploading more than that.

I've looked everywhere to solve this issue, I've also looked into openlitespeed's max request body size since it's seems like it's what the error on my error log shows, but most of the answers I've seen were from several years ago and no longer applies and didn't resolve the issue.

There doesn't seem to be any issue with my php script as well as my javascript from my tests since it works with no issues on my local server, and works fine with small file sizes on my web server.

Is there anyway to resolve this issue?

blurreJel
  • 1
  • 1
  • 1
  • That error message sounds like it comes from your webserver, not from php. What is your `maxReqBodySize` configuration set to in OpenLiteSpeed? – rickdenhaan Mar 25 '22 at 12:09
  • I've been looking everywhere to find maxReqBodySize but I've had no luck in finding where it's actually located. Where can I find such setting on my webserver? – blurreJel Mar 25 '22 at 12:12
  • According to [the documentation](https://openlitespeed.org/kb/ols-configuration-examples/), there should be a `httpd_config.conf` file in `/usr/local/lsws/conf` but the setting can be overridden in specific virtual host config files in the `vhosts` subfolder. You should also be able to find it in the Tuning section of the [WebAdmin Console](https://openlitespeed.org/kb/ols-web-admin-console/#Server_Configuration_-_Tuning). – rickdenhaan Mar 25 '22 at 12:49
  • Since you mentioned I could override it in specific vhost config files. I added this: `tuning { maxReqBodySize 2047M maxDynRespSize 2047M maxCachedFileSize 4096 }` To the end of my website's vhost config, I'm not entirely sure if that's the correct way of doing it, I'm just using OpenLiteSpeed's configuration examples as basis of editing the vhost. But after editing the vhost and restarting, it still does not work. I don't have WebAdmin console since I'm using CyberPanel which is sometimes a pain to use. And in the httpd_config file, it says not to edit since it's auto generated. – blurreJel Mar 25 '22 at 13:15
  • Any idea on how to edit the maxReqBodySize on CyberPanel? My website's vhost currently looks like [this](https://www.valoclips.com/admin/u/file-1648214311-P6nRSjIKEHkrCXeD8iUc.jpg) I added it right after `` and it's still not working. I'm not entirely sure if I'm doing it correctly as I'm very new to using webservers. I've also restarted OpenLiteSpeed after editing the vHost. – blurreJel Mar 25 '22 at 13:22
  • I have never used CyberPanel so I can't help you there. It looks like it takes some control out of OpenLiteSpeed's hands. If no-one else here can help, maybe the [CyberPanel support forum](https://community.cyberpanel.net/c/support/web-server/59) can help you figure it out? – rickdenhaan Mar 25 '22 at 13:27

0 Answers0