Question

How to change the maximum upload file size in LiteSpeed/WordPress

I have found many solutions for this, but I’m looking for the simplest, least-intrusive way to change the maximum upload file size for WordPress. Specifically, for a droplet created with the LiteSpeed/WordPress image from DO’s marketplace.

I attempted to add the line php_value upload_max_filesize 64M to the bottom of the .htaccess file using LiteSpeed’s built-in “Edit .htaccess” menu command. It did nothing.

Also, I had to do a sudo reboot from ssh because I cannot figure out how to reboot just the web server, either.

  • sudo service nginx restart doesn’t work.
  • sudo service httpd restart doesn’t work.
  • sudo service apache restart doesn’t work.
  • sudo service apache2 restart doesn’t work.

They all give me Unit <servicename>.service not found.


Finding and editing the correct php.ini file, then force-rebooting the entire droplet seems a bit harsh to me, as though there should be a more elegant way.

Is there?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

For anyone maybe interested. The fix method is to increase the post_max_size value, not the upload_max_file and then do service lsws restart or killall lsphpnew. ^ ^

How To Change The Maximum Upload Limit And Maximum Post Limit In Open Litespeed WordPress PHP7.4

for example, I am using php7.4

Update post_max_size and upload_max_filesize value from /usr/local/lsws/lsphp73/etc/php/7.4/litespeed/php.ini

or you can make sure your PHP version first, check on info.php then find (CTRL + F)

upload_max_filesize = xxxxM Can Edit You as want post_max_size = xxxxxM Can Edit You as want

Then Save it (CTRL + S)

Finally, you must restart with this command

service lsws restart && killall lsphp

because if you just type : “killall lsphpnew” or “service lsws restart” the command is not working…

Reference: How To Change The Maximum Upload Limit And Maximum Post Limit In Open Litespeed WordPress PHP7.4

Happy Codding Guys.

Max upload filesize Plugin