How to increase maximum upload file size in LiteSpeed/WordPress/Ubuntu 20

Unlike Apache, LiteSpeed requires to restart each service interacting with it. PHP isn’t excluded of this rule, so you must restart it too after changing the php.ini file.

1/ Edit the following line (here for php8):


For instance with nano:

nano /usr/local/lsws/lsphp80/etc/php/8.0/litespeed/php.ini

2/ Change upload_max_filesize & post_max_size (you might consider increasing max_execution_time & max_input_time too)

3/ Restart BOTH LiteSpeed & WordPress:

service lsws restart && killall lsphp

And… That’s it !

Here is what ChatGPT knows about openlitespeed and upload_max_filesize:

OpenLiteSpeed is a high-performance open source web server software that can be used to serve web content and applications. The “upload_max_filesize” setting in OpenLiteSpeed is a PHP directive that determines the maximum size of a file that can be uploaded to a website.

To change the “upload_max_filesize” setting in OpenLiteSpeed, you need to modify the php.ini file on your server. This can be done by locating the php.ini file, opening it in a text editor, and changing the value of “upload_max_filesize” to the desired size. After making the change, you’ll need to restart OpenLiteSpeed to ensure that the new setting takes effect.

It’s important to note that changing the “upload_max_filesize” setting can have implications for server performance and security, so it should be done with care. Large file uploads can consume a lot of server resources and may leave the server vulnerable to attacks, so it’s recommended to set a reasonable limit that meets the needs of your website or application while also protecting your server.

=> ChatGPT knows the solution, again ! 🙂


Leave a comment

Your email address will not be published. Required fields are marked *