In the top left corner, you will see icons to add files and directories:Ĭlick the “+ File” button to create a new file. Navigate as follows: cPanel > Files > File ManagerĪ new window will open showing the file system. Log into your user’s cPanel account at the following URL (replacing yourdomain.tld with your actual domain): You can use cPanel’s File Manager, FTP, or SSH if the cPanel user has SSH access. If you do not have root access and need to make these changes as the cPanel user, there are a few ways you can do this. The permissions should read as follows if set to 644: -rw-r-r- cPanel User Access Do the following to view the file: ls -lah /home/cp_user/public_html/error_log To create the file under the cPanel user ‘cp_user’, you would do the following as the user root via SSH (the document root for most cPanel-hosted main domains is the public_html): cd /home/cp_user/public_htmlĪlso, be sure that the log can be written to by the user (permissions of 644 should be fine for most KnownHost systems). Go ahead and determine what settings you will be using. htaccess rule to prevent unauthorized access to this log. I typically place these in the public_html, and then also make a.
You may have to create the error_log file, replacing ‘/path/to/docroot/error_log’ with the exact path to the file.
The recommended settings for a development site that is not live are below: log_errors = onīoth of the examples shown above do not include an actual path.
NOTE: Displaying PHP errors on a live site is a security issue so do not enable this setting on a live site! Here are the recommended settings for a live site: log_errors = on If the site is not live, then you may also choose to have the errors displayed on the site in the browser. Most of the time, you will simply choose to have PHP errors logged to a private log in a location that you specify. You should decide what log settings you need to set before enabling. Doing so will cause PHP errors to be logged in the location you choose so that you can determine what is causing the error and work to fix it. Or a “500 error” that doesn’t log to the Apache error log as ‘real’ 500 level errors do, then you will need to enable PHP error logging for your site to find the script error. If you have encountered the dreaded ‘white page of death’ error (that error that loads a blank page and tells you nothing regarding what is wrong). You may want to enable PHP error logging if you’re actively developing your site to aid in troubleshooting. There are several reasons you may choose to enable PHP error logging.
#CPANEL PHP ERROR LOG HOW TO#
That's all! Now you learned how to enable error reporting from your cPanel.PHP error logging for your site is an optional level of logging that can be enabled to log errors that occur with PHP code. Once this option is selected, simply click on the "Apply" button and "Save" from the bottom of this page.Īll new PHP errors and warnings will be written in the root folder of your application in a file named "error_log". To enable error reporting, you need to select E_ALL. If you click on E_ALL, you will be displayed with a drop-down menu, from where you can enable it: You will need to click on E_ALL to change it. In PHP Options, you will be displayed with the following options: Here we will need to go to "Switch to PHP Options" from the right side on the screenshot, so we could enable PHP error logging. Once you access the "Select PHP Version", you will be displayed with the following options:
#CPANEL PHP ERROR LOG SOFTWARE#
To enable PHP error logginig, firstly go to your cPanel and navigate to "Select PHP Version", under the Software menu. In order to check the PHP error log for your application and find any warnings/errors that are being displayed, firstly you need to make sure that PHP error logging is enabled. How to enable PHP error logging in cPanel