There are two approaches to edit the php.ini file associated with OpenLiteSpeed: directly from the Bunnyshell interface (recommended) or editing the file directly on the server using an SSH connection.

Note: if you only wish to alter the php.ini for Wordpress (to increase the maximum upload file size), you should follow this article.

To modify the php.ini settings directly from the Bunnyshell interface:

1. From your virtual machine page, go to Virtual Machine -> select your VM -> OPS -> Packages -> OpenLiteSpeed (Edit) -> Configuration Files

2. You will notice that the php.ini settings are listed in the Script Editor. As such, you can modify the settings to your preference. Find the line corresponding to the particular setting that you want to modify (you can use Ctrl + F to find the lines fast):

Please note that there are 2 setting that you should edit:

upload_max_filesize = 2M can be changed to upload_max_filesize = 128M

post_max_size = 8M can be changed to post_max_size = 254M

3. After the settings are set, hit Update Package at the bottom of the page. This will take you back to the Packages page.

4. Make sure the OpenLiteSpeed package is Marked for deployment (green switch is on)

5. Hit Deploy Changes

To modify the php.ini settings using an SSH connection:

  1. SSH to your virtual machine on which OpenLiteSpeed is installed

  2. Edit the following file with your preferred text editor: /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini

Note: the PHP version might be different for your particular configuration. For example, if the PHP is version 7.1, the path would be /usr/local/lsws/lsphp71/etc/php/7.1/litespeed/php.ini

also, the full file path can be obtained from the Configuration Files tab mentioned above.

Furthermore, if you want to alter the settings of a specific website you should also alter the /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/ftpuserxxxxx/php.ini. The correct username is found by looking at the website's folder.

3. Find the line corresponding to the particular setting that you want to modify:

Eg: upload_max_filesize = 2M can be changed to upload_max_filesize = 128M and

post_max_size = 8M can be changed to post_max_size = 254M

4. Restart OpenLiteSpeed service:

  • From the command line:

sudo service lsws restart

  • From Bunnyshell:

Go to virtual machine page -> Services -> Click the 3 dot menu coresponding to OpenLiteSpeed -> Restart Service.

Did this answer your question?