Enable Error Reporting

For many types of issue, the first step in troubleshooting is enabling WHMCS’s error reporting system.

  • We strongly recommend that you only enable error reporting while you are actively troubleshooting an issue. Disable it as soon as you are finished.
  • Error reporting will display verbose error information to anyone on your system who experiences an error, including customers and non-privileged admins. This can become a security concern.

What does error reporting do?

When you enable error reporting, you can easily log and view additional information about the following types of error:

Depending on the type of issue that you are troubleshooting, you may prefer to enable Log Errors or SQL Debug Mode. These options capture many of the same errors that Display Errors logs.

Enable Error Reporting

You can enable error reporting in the Admin Area or from the configuration.php file.

We recommend enabling error reporting from the Admin Area unless you currently cannot access it.

In the Admin Area

To enable error reporting from the Admin Area:

  1. Go to Configuration () > System Settings > General Settings.
  2. Choose the Other tab.
    The Other tab in General Settings
  3. Select Display Errors.
  4. Click Save Changes.
  5. Retry the steps that previously led to the problem. The system will display additional error information.
  6. When you are finished troubleshooting, disable Display Errors.

In the Configuration File

If the error is severe enough, you may not be able to log in to the Admin Area. In those situations, you can enable error reporting in the configuration.php file in the WHMCS root directory.

To do this:

  1. Open the configuration.php file in your preferred editor.

  2. Add the following line immediately before the closing PHP tag (?>):

    $display_errors = true;
    
    For more information, see The configuration.php File.
  3. Save your changes.

  4. Retry the steps that previously led to the problem. The system will display additional error information.

  5. When you are finished troubleshooting, remove the $display_errors line from the configuration.php file or disable Display Errors in the Other tab at Configuration () > System Settings > General Settings.

    Sometimes, you may also see the following lines in the configuration.php file:
    • $display_errors = E_NOTICE;
    • $display_errors = E_ALL;
    As a precaution, remove any lines starting with $display_errors from the configuration.php file.

PHP Error Reporting

If the Display Errors feature is disabled and you’re still seeing warning messages, it indicates that the Error Reporting level in your server’s PHP configuration is too high. This is a PHP configuration level issue.

To resolve this issue on cPanel & WHM servers:

  1. In WHM, go to Software » MultiPHP INI Editor.

  2. Click the Editor Mode tab.

  3. Select your PHP version from the Select a PHP version menu.

  4. Scroll down to the error_reporting setting.

  5. Change the value to the following string:

    E_ALL & ~E_WARNING & ~E_USER_WARNING & ~E_NOTICE & ~E_USER_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED

If you have set it correctly, the error_reporting variable within the server’s PHP configuration will show a numerical value of 4597.

For help, contact your hosting provider or system administrator.

Last modified: June 14, 2024