How to enable PHP error log in OpenliteSpeed | RunCloud
If you are using OpenLiteSpeed within a RunCloud environment, you may have noticed that some PHP errors do not appear in the web server log section. This could be useful if your website is experiencing problems.
Introduction
OpenLiteSpeed is a lightweight, open-source web server that offers great performance and low resource consumption. When you are running PHP applications on OpenLiteSpeed web server, you may encounter errors and issues that can be difficult to diagnose without proper error logging. In this blog post, we will show you how to enable PHP error log in OpenLiteSpeed with RunCloud.
By using RunCloud, you can easily configure your OpenLiteSpeed web server and enable PHP error log to diagnose and fix issues in your PHP applications.
Please take note that you can skip step 2 if the error configuration is already present in your setup(check step3).
Here are the steps to enable PHP error log in OpenLiteSpeed with RunCloud:
Step 1: Login to RunCloud
First, log in to your RunCloud account and select the server that you want to configure.
Step 2: Open Server LiteSpeed Configuration
In the server dashboard, We need to make sure that debug option is enabled from server level first. For that, we just need to do following 4 steps.
- First click on "LiteSpeed" option from left side, this will open up litespeed configuration /usr/local/lsws/conf/httpd_config.conf in panel.
- If you are using an outdated version or you cannot locate the error configuration specified in step 3, click "Reset Default."
- As shown in the above image, scroll down to find the error log section. Verify that the "logLevel" option is set to "DEBUG."
- Finally, you can update the config by clicking on "Update config" button at the bottom.
Step 3: Open WebApp's LiteSpeed Configuration
Next, click on the “Web Application” option and select the specific web application that requires error logging to be enabled.
- First click on the "LiteSpeed config" option and this will open up the litespeed config specific to this webapplication.
- To update the configuration with the error logging option, click the "Reset Default" button. Please note this will remove any additional config added from your side so you are only required to click on reset if it's an old web application as newly created web application will have the error logging config available.
- Even for newly built web applications, the default value for "logLevel" is "ERROR," but we must change it to "DEBUG" in order to display PHP errors.
- Click on "Update Config" once these changes are made.
That’s it! You have successfully enabled PHP error log in OpenLiteSpeed with RunCloud. Now, any errors or issues that occur in your PHP applications will be logged in the error log file(webapplication > Web Server Log > LSWS Error), which you can access and analyze to diagnose and fix issues in your applications.
Conclusion
Enabling PHP error log in OpenLiteSpeed with RunCloud is a simple process that can greatly help you in diagnosing and fixing issues in your PHP applications. By following the steps outlined in this blog post, you can easily enable error logging for your PHP applications and ensure that you have the necessary information to fix any issues that arise.
Comments
Post a Comment