Error Pages

The WHMCS application will suppress all non-critical warnings and notices and attempt to complete all requested actions in its default configuration. If an error condition is critical and the continued execution of a requested action is either detrimental or not possible, the system will display a friendly, styled error page and log the event.

An Oops! error in WHMCS

If you want to customize this behavior, WHMCS provides several methods to define your error options in a way that best addresses your production and debugging needs.

  • If the system encounters an error condition before WHMCS has the opportunity to initialize, the system renders a rudimentary but HTML-friendly body. If this is not possible due to the timing of the error, the system will use the server environment settings.
  • For more information about how WHMCS handles errors, see Error Handling.

Error Templates

We introduced Twenty-One in WHMCS 8.1. We plan to remove Six in a future version.

The Twenty-One and Six system themes use system theme error templates in the following locations:

  • errors/internal-error.tpl
  • errors/page-not-found.tpl
  • errors/unknown-routepath.tpl

Custom Themes

If you create a custom theme, you can customize these pages by creating these files in your theme’s directory (for example, /templates/example/error/internal-error.tpl, where example is the directory for your custom theme).

You cannot alter the dynamic content of this file. However, your customized file can alter the placement, provide its own hardcoded alternative, or exclude this dynamic content. To help reduce any further possible error paths, Smarty doesn’t process this file.

Error Template Variables

These files can use the following variables:

VariableDescription
cssAny CSS content. By default, this is in the HTML head tag.
emailThe configured default email address in the General tab at Configuration () > System Settings > General Settings.
stacktraceThe PHP stack trace of the error condition. The system only populates this information if Display Errors is enabled via the configuration file or in the Other tab at Configuration () > System Settings > General Settings.
systemurlThe configured System URL setting in the General tab at Configuration () > System Settings > General Settings.
titleThe document title. By default, this is in the title tag in the head tag, as well as within an h1 tag of the default body.

Last modified: October 30, 2024