Difference between revisions of "Enabling Error Reporting"

From WHMCS Documentation

(If you are unable to access the Admin Area)
Line 1: Line 1:
==When Should You Enable Error Reporting==
+
==Getting Error Information==
 
+
The [[Error_Management]] documentation provides a full description of the WHMCS Error Management system and all possible options at your ready.  The following sections provide an abridged description of the Display Errors option and overview on how you should consider utilizing it.
Error reporting is useful when you are experiencing a critical error that is resulting in either:
 
  
 +
===When Should You Enable Display Errors===
 +
Display Errors option will often provide additional information when you are experiencing a critical error that is resulting in on of the following:
 +
* Friendly "Oops!" pages
 
* Entirely blank pages
 
* Entirely blank pages
 
* Partially rendered pages
 
* Partially rendered pages
  
==Typical Causes==
+
In most cases, you will want to use the Log Errors and SQL Debug Mode first, if possible.  These options usually will capture the same information that is rendered by the Display Errors option.  In the event that these options are not viable or do not yield any information, Display Errors is a good alternative. 
 +
 
 +
''The Display Errors option is very handy however it will show your error information to anyone who is encountering the same error condition.  Showing errors to visitors or non-privileged staff should be avoided when possible.''
  
Some of the most common causes of partial or empty page rendering include:
+
===Typical Causes===
 +
Some of the most common causes of "Oops!", partial, or empty page rendering include:
  
 
* Missing or corrupted files / incomplete uploads
 
* Missing or corrupted files / incomplete uploads
Line 16: Line 21:
 
* Syntax errors in custom modules, hooks or templates
 
* Syntax errors in custom modules, hooks or templates
  
==If you can access the Admin Area==
+
===Enabling From The Admin Area===
 
 
 
If the admin area is functioning enough to allow you to navigate to '''General Settings''' follow these steps to enable error display.  Then retry the steps that previously led to the blank or partially rendered page and further error information should be displayed.
 
If the admin area is functioning enough to allow you to navigate to '''General Settings''' follow these steps to enable error display.  Then retry the steps that previously led to the blank or partially rendered page and further error information should be displayed.
  
Line 26: Line 30:
 
''Remember to return here and uncheck Display Errors when you are finished troubleshooting.  Leaving error display enabled can be a security concern.''
 
''Remember to return here and uncheck Display Errors when you are finished troubleshooting.  Leaving error display enabled can be a security concern.''
  
==If you are unable to access the Admin Area==
+
===Enabling From Your Configuration File===
 
 
 
If the error is severe enough, you may find you are unable to login to the admin area. In those situations, there is a manual configuration file flag option that you can add to the configuration.php file in the WHMCS root directory to enable error reporting.
 
If the error is severe enough, you may find you are unable to login to the admin area. In those situations, there is a manual configuration file flag option that you can add to the configuration.php file in the WHMCS root directory to enable error reporting.
  
The lines needs to be added at the very end of the configuration.php file, right before the closing PHP tag ?> if your configuration.php file has one, otherwise just the last line in the file.
+
The lines needs to be added at the very end of the configuration.php file, right before the closing PHP tag (''?>'') if your configuration.php file has one, otherwise just the last line in the file.
  
 
<source lang="php">
 
<source lang="php">
Line 36: Line 39:
 
</source>
 
</source>
  
After adding the lines and saving/uploading the file, retry the steps that previously led to the blank or partially rendered page and further error information should be displayed.
+
After adding the lines and saving/uploading the file, retry the steps that previously led to the "Oops!", blank, or partially rendered page and further error information should be displayed.
  
 
''Again remember to return here and remove these lines when you are finished troubleshooting.  Leaving error display enabled can be a security concern.''
 
''Again remember to return here and remove these lines when you are finished troubleshooting.  Leaving error display enabled can be a security concern.''

Revision as of 20:23, 12 May 2017

Getting Error Information

The Error_Management documentation provides a full description of the WHMCS Error Management system and all possible options at your ready. The following sections provide an abridged description of the Display Errors option and overview on how you should consider utilizing it.

When Should You Enable Display Errors

Display Errors option will often provide additional information when you are experiencing a critical error that is resulting in on of the following:

  • Friendly "Oops!" pages
  • Entirely blank pages
  • Partially rendered pages

In most cases, you will want to use the Log Errors and SQL Debug Mode first, if possible. These options usually will capture the same information that is rendered by the Display Errors option. In the event that these options are not viable or do not yield any information, Display Errors is a good alternative.

The Display Errors option is very handy however it will show your error information to anyone who is encountering the same error condition. Showing errors to visitors or non-privileged staff should be avoided when possible.

Typical Causes

Some of the most common causes of "Oops!", partial, or empty page rendering include:

  • Missing or corrupted files / incomplete uploads
  • Server not meeting minimum system requirements
  • PHP, Apache or Ioncube related errors
  • Incompatible hooks or addons
  • Syntax errors in custom modules, hooks or templates

Enabling From The Admin Area

If the admin area is functioning enough to allow you to navigate to General Settings follow these steps to enable error display. Then retry the steps that previously led to the blank or partially rendered page and further error information should be displayed.

  1. Navigate to Setup > General Settings > Other
  2. Tick the Display Errors checkbox located towards the bottom of the page
  3. Click Save Changes

Remember to return here and uncheck Display Errors when you are finished troubleshooting. Leaving error display enabled can be a security concern.

Enabling From Your Configuration File

If the error is severe enough, you may find you are unable to login to the admin area. In those situations, there is a manual configuration file flag option that you can add to the configuration.php file in the WHMCS root directory to enable error reporting.

The lines needs to be added at the very end of the configuration.php file, right before the closing PHP tag (?>) if your configuration.php file has one, otherwise just the last line in the file.

$display_errors = true;

After adding the lines and saving/uploading the file, retry the steps that previously led to the "Oops!", blank, or partially rendered page and further error information should be displayed.

Again remember to return here and remove these lines when you are finished troubleshooting. Leaving error display enabled can be a security concern.