Openlitespeed server + WordPress: can't upload large files

96 views Asked by At

I realize that this has been asked before, but the previous questions seem to be nginx based servers. I am running into this issue using Openlitespeed on a digitalocean droplet. Specifically, when I upload files over ~200MB this is the error: Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page

I am running Wordfence, and have tried putting the firewall into learning mode as well as disabling it, and still cannot upload anything larger than about 200MB even though I have enabled unlimited file upload sizes.

Reading through the nginx solution, I see that this was the given fix: client_max_body_size 10M;

Is there an equivalent in openlitespeed?

Any help would be greatly apprecaited!

2

There are 2 answers

1
Sgt Santana On

Are you using OpenLiteSpped with cyberpanel? If so, you can change the upload limit on the control panel

0
Eric On

If you hit the PHP limit, you should expect a warning on the WordPress page.

XXfilename exceeds the maximum upload size for this site.

Fix method

Edit the /usr/local/lsws/lsphp81/etc/php/8.1/litespeed/php.ini file to configure PHP parameters.

To increase the allowed file size, for example, you would make the following edits:

upload_max_filesize = 500M
post_max_size = 500M

Then restart php with the command killall -9 lsphp to make settings take effect

Note 1: If you are using a different version, please adjust the number in the URL accordingly.

Note 2: If you hit the PHP timeout limit, please increase the value of max_input_time from the php.ini file as well.

If the above method does not help, then you might need to check both the server and PHP error logs.