If you are using any PHP or Perl scripts, and you are familiar with web programming, you'll want to create error logs. Error logs are generated anytime an error occurs while you are running a PHP or Perl script. If there is an error, the error_log file is created and stored in the root directory.
The error_log file can help you find and correct errors in your script more quickly than if you simply reread all of your code. Whenever there is an error or warning generated by PHP or Perl — for example, if there is a syntax error in your code that is causing your script to fail — these errors are written to the error_log file with the most recent entries at the bottom of the log. In the sample code below, for instance, you can see that there is a PHP error in line 9 of a script.
[26-Jun-2016 22:35:14\ PHP Parse error: parse error in /php/bug.php on line 9
Jump to:
View the error log file in cPanel File Manager
- Sign in to your My Services page.
- Click the Web Hosting link.
- Click the File Manager link in the Files module. A new window opens to the File Manager.
- Double click the public_html link in the right column.
- Click the error_log file to highlight the row.
- Click the Download link to download the error log file to your local drive or the View link to view the file in the File Manager.
Note: If you would like to display more detailed warnings in your log file to help troubleshoot a Perl script, click the Edit link, include the following line at the top of your script and click the Save Changes button:
#!/usr/bin/perl –w
Important: Your error_log file can reach a maximum size of 10MB. If your file exceeds this size, your error output will no longer be recorded, and you could encounter errors. Either delete or rename the error_log file, then visit your site and a new one will be created automatically when errors are being generated.
View the error log file in cPanel Metrics
Note: The error log in cPanel Metrics only displays errors such as broken links and missing files.
- Sign in to your My Services page.
- Click the Web Hosting link.
- Click the Errors link in the Metrics module.
- The web server error log displays up to 300 of the most recent entries in reverse chronological order.
View the access log file in cPanel File Manager
- Sign in to your My Services page.
- Click the Web Hosting link.
- Click the File Manager link in the Files module. A new window opens to the File Manager.
- Click the logs folder in the left pane column or double click it in the right column.
- Select and click the log file you want to view by highlighting the row.
- Click the Download link to download the log file to your local drive and extract the contents. Note: You can also extract the log file in the File Manager by clicking the Extract link.
See Also: