In this blog we will cover how to update specific webapplication PHP values which are not mentioned in RunCloud dashboard. Please note, this is only for OpenLiteSpeed users.
Introduction
Updating individual PHP values for your web application can be a tedious task, especially when you only want to make changes on specific websites. By default, RunCloud offers some options for modifying PHP values, but for the rest, you would typically need to access the main PHP.ini file via the terminal. However, this isn't always the most convenient or desirable solution, as it can affect all the sites that use these resources. In this blog, we'll explore a more user-friendly approach for updating PHP values on a per-site basis using the .user.ini file in OpenLiteSpeed.
Step 1: Enable the use of .user.ini file in LiteSpeed configuration
To begin, we need to enable the use of the .user.ini file in the LiteSpeed configuration. This is not enabled by default, so we'll need to make a few changes. First, go to your RunCloud dashboard and select the web application you want to modify. On the left side of the dashboard, you should see an option called "LiteSpeed Config." By default, this will look something like this:
To enable the use of the .user.ini file, we need to add the following line after the existing lines with "env":
env LSPHP_ENABLE_USER_INI=on
Once you've added this line, the final configuration should look something like this:
Step 2: Create a .user.ini file and add your specific values
Now that we've enabled the use of the .user.ini file, we just need to create the file and add our desired values. To do this, go to the "File Manager" option and create a new file called ".user.ini." For example, here's an example of attaching a wordfence-waf.php file using the "auto_prepend_file" value.
Another use case of .user.ini is on newrelic installation which is mentioned here How to install New Relic in OpenLitespeed server in RunCloud and connecting Wordpress site. (linuxandruncloud.blogspot.com)
You can also update other values as well. Just keep in mind that the values you can adjust from the RunCloud panel will have higher priority, so it's best to use the .user.ini file only for values that you can't modify through the dashboard.
Conclusion
Using the .user.ini file in OpenLiteSpeed is a convenient and user-friendly way to update specific PHP values for your web application on a per-site basis. By following the steps outlined above, you can easily make changes to your PHP values without needing to access the terminal or affect other sites that use the same resources.
Thank you! I've spent far too long trying to get this working but all sorted now I've followed the steps above
ReplyDeleteMy pleasure :)
Delete