Difference between revisions of "Blank or Partially Rendered Pages"

From WHMCS Documentation

m (General)
(Admin Login Page Only)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
If at any time you encounter a blank page in the WHMCS system then this indicates a fatal PHP error is occurring. This page explains the common causes of such problems, how to identify and subsequently resolve them.
+
If at any time you encounter a blank or partially rendered page in your WHMCS installation, this indicates a fatal PHP error is occurring which stops the execution from being able to continue. This page covers the most common causes of these problems, how to identify them and methods for resolution.
  
==General==
+
The display of error information is disabled by default. For more information, see [[Error Management]].
Error display is turned off by default for security so in order to see what error is occurring, you need to enable error display. First please ensure display_errors is enabled in the server's PHP configuration and enable the '''Setup > General Settings > Other tab > Display Errors''' option, then reproduce the blank page problem.
 
  
You should now see an error output to the screen. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:
+
<div class="docs-alert-warning">
 +
Enabling '''Display Errors''' while your installation is accessible to end users may lead to potential security risks due to the information within the error message details. Make certain to disable '''Display Errors''' when you finish debugging.
 +
</div>
  
*[[Server Modules]]
+
{{:Enabling_Error_Reporting}}
*[[Domain Registrars]]
 
*[[Common Troubleshooting Tips]]
 
  
If you are unable to access the admin area to enable this option, or you are running version 4 and earlier add the following line to your WHMCS configuration.php file instead and then reproduce the blank page problem. Once testing is complete, be sure to untick the option or remove the $display_errors line again from that file so that clients aren't getting warnings or errors.
+
==Further Troubleshooting Steps==
  
<source lang="php">$display_errors = true; </source>
+
===Client Area Only===
  
Often the error message will be explanatory enough for you to identify what the issue is. Common problems are errors in custom modules, hook code, template customisations & variables, or entirely missing/non-updated files.
+
If the admin area is loading correctly and only the client area is blank, the template folder may be missing or the <tt>/templates_c</tt> folder may have an invalid path or may not be writeable.
 
 
==Client Area Only==
 
If the admin area is loading correctly and only the client area is blank this suggests the template folder missing or the /templates_c folder invalid path/not writeable.
 
  
 
To resolve this:
 
To resolve this:
*Re-select template under ''Setup > General Settings'' and clicking Save Changes.
+
# Re-select the template at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' or, prior to WHMCS 8.0, '''Setup > General Settings''' and click '''Save Changes'''.
* Ensure the templates_c has the appropriate permissions/CHMOD and ownership values so it's writeable by the script (usually CHMOD 777).
+
# Ensure that the <tt>templates_c</tt> folder has the appropriate permissions and is writeable by the script (usually <tt>CHMOD 755</tt>, but in some environments may require <tt>CHMOD 777</tt>).
*If the /templates_c directory has been moved to a [[Further_Security_Steps#Move_the_attachments.2C_downloads_.26_templates_c_folders|custom location]] ensure the path is correct in the configuration.php file. Your server admin/hosting provider will be able to confirm this.
+
# If the <tt>/templates_c</tt> directory has been moved to a [[Further_Security_Steps#Move_the_attachments.2C_downloads_.26_templates_c_folders|custom location]], ensure the path is correct in the <tt>configuration.php</tt> file. For help, contact your hosting provider or system administrator.
  
==Admin Login Page Only==
+
===Admin Login Page Only===
The admin login page does not involve templates, so seeing a blank page here suggests a problem with the Ioncube configuration on your server. You can download the Ioncube Loader Wizard from http://www.ioncube.com/loaders.php and upload to your whmcs directory, then visit it in your browser. Your server admin/hosting provider will need to resolve any errors it identifies.
 
  
If it reports Ioncube is installed correctly please ensure display_errors is enabled in the server's PHP configuration as this may be suppressing out error messages WHMCS is trying to output with the display_errors line in the configuration.php file detailed above.
+
The admin login page does not use templates, so a blank page indicates a problem with the ionCube configuration on your server.  
  
Problematic custom widgets may also cause a blank page. Try removing any non-standard files from the '''/modules/widgets''' directory.
+
To find more troubleshooting information:
  
==Admin Area Only==
+
# Download the [http://www.ioncube.com/loaders.php ionCube Loader® Wizard].
Blank pages in just the admin area are caused by renaming the 'admin' directory but not specifying the name name in the configuration.php file. Ensure this has been done as described [[Further_Security_Steps#Change_your_WHMCS_Admin_Folder_Name|in our documentation]].
+
# Upload it to the <tt>whmcs</tt> directory.
 +
# Visit it in your browser.  
  
 +
For help resolving any errors, contact your hosting provider or system administrator.
  
==Redirect Pages Only==
+
If it reports that ionCube Loader is installed correctly, ensure that <tt>display_errors</tt> is enabled in the server's PHP configuration. This can suppress WHMCS error messages with the <tt>display_errors</tt> line in the <tt>configuration.php</tt> file.
When blank pages are only occurring on redirect pages such as shopping cart redirect to payment gateway page, or upon client/admin login this means a blank space is being output by the configuration.php or an action hook file.
 
  
Review the configuration.php file and ensure there are no blank spaces or carriage returns outside the <?php and ?> tags. The same goes for the files in the /includes/hooks directory.
+
Problematic custom widgets may also cause a blank page. Try removing any non-standard files from the <tt>/modules/widgets</tt> directory.
  
 +
===Oops! or Blank Pages Elsewhere===
  
==Blank Pages Elsewhere==
+
If blank pages are occurring on all pages, try all the above steps, particularly enabling <tt>display_errors</tt>. If the problem persists, review any custom files in the following locations and ensure there are no blank spaces or carriage returns outside the <tt><?php</tt> and <tt>?></tt> tags:
If blank pages are occurring on all pages, please try all the above steps, particularly enabling display_errors. If none of the above resolves the issue review any custom files in the following locations and ensure there are no blank spaces or carriage returns outside the <?php and ?> tags:
 
  
*/configuration.php
+
*<tt>/configuration.php</tt>
*/includes/hooks/
+
*<tt>/includes/hooks/</tt>
*/modules/admin/
+
*<tt>/modules/admin/</tt>
*/modules/addons/
+
*<tt>/modules/addons/</tt>
*/modules/registrars/
+
*<tt>/modules/registrars/</tt>
*/modules/servers/
+
*<tt>/modules/servers/</tt>
*/modules/widgets/
+
*<tt>/modules/widgets/</tt>
*/lang/
+
*<tt>/lang/</tt>
*/lang/overrides/
+
*<tt>/lang/overrides/</tt>
*/admin/lang/
+
*<tt>/admin/lang/</tt>
*/admin/lang/overrides/
+
*<tt>/admin/lang/overrides/</tt>
  
 
It may be necessary to remove any custom files from these locations temporarily, if doing so resolves the issue then you can add them back one-by-one until the problem re-occurs, you can then contact the vendor of the offending file for a fix.  
 
It may be necessary to remove any custom files from these locations temporarily, if doing so resolves the issue then you can add them back one-by-one until the problem re-occurs, you can then contact the vendor of the offending file for a fix.  
  
If none of the steps on this page fix the problem then please contact [http://www.whmcs.com/get-support/ our support team] for assistance. In your support ticket please include the attempts you have made to resolve the issue, instructions to reproduce the blank page and FTP/SFTP access.
+
If none of the steps on this page fix the problem, contact [http://www.whmcs.com/get-support/ our support team] with a description of the troubleshooting you have done, reproduction instructions, and FTP/SFTP access.
 
 
  
 
{{troubleshooting}}
 
{{troubleshooting}}

Latest revision as of 17:08, 18 August 2022

If at any time you encounter a blank or partially rendered page in your WHMCS installation, this indicates a fatal PHP error is occurring which stops the execution from being able to continue. This page covers the most common causes of these problems, how to identify them and methods for resolution.

The display of error information is disabled by default. For more information, see Error Management.

Enabling Display Errors while your installation is accessible to end users may lead to potential security risks due to the information within the error message details. Make certain to disable Display Errors when you finish debugging.

Getting Error Information

The WHMCS Error Management system includes many useful options. Display Errors allows you to view additional information about critical errors.

When Should You Enable Display Errors

Display Errors provides additional information when you experience a critical error that results in one of the following issues:

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

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

Display Errors will show your error information to anyone who is encountering the same error condition. Avoid showing errors to visitors or non-privileged staff whenever possible.

Typical Causes

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

  • Missing or corrupted files or incomplete uploads.
  • The server doesn't meet the minimum system requirements.
  • PHP, Apache, or ionCube Loader®-related errors.
  • Incompatible hooks or addons.
  • Syntax errors in custom modules, hooks, or templates.

Enabling Error Reporting

Enabling From The Admin Area

If possible, attempt the following steps to enable Display Errors via the Admin Area:

  1. Go to Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings.
  2. Choose the Other tab.
  3. Select Display Errors.
  4. Click Save Changes.
  5. Retry the steps that previously led to the blank or partially-rendered page. The system will display additional error information.

Remember to disable 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 not be able to log in 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.

Add the lines to the end of the configuration.php file. This will be immediately before the closing PHP tag (?>) if your configuration.php file has one. If it doesn't, this will be after the last line in the file.

$display_errors = true;

After adding the lines and saving and uploading the file, retry the steps that previously led to the blank or partially rendered page. The system will display additional error information.

Remember to disable Display Errors when you are finished troubleshooting. Leaving error display enabled can be a security concern.

Disabling Error Reporting

Disabling from the admin area

If you enabled error reporting via the admin area, make sure to follow the steps below after you finish troubleshooting:

  1. Navigate to Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings.
  2. Choose the Other tab.
  3. Deselect Display Errors at the bottom of the page.
  4. Click Save Changes.

Disabling from the configuration.php file

If you enabled error reporting via the configuration.php file, make sure to remove the following line from the configuration.php file after you finish troubleshooting.

$display_errors = true;

Sometimes, you may also see the following lines in 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 Warnings and Notices

If the Display Error options are disabled and you're still seeing warning messages, it indicates the Error Reporting level in your server's PHP configuration is too high. This is a PHP configuration level issue. Shared hosting or reseller users may require the assistance of the hosting provider.

If you have sufficient access and have configured your server to use WHM for administration, follow these steps:

  1. In WHM, navigate 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.

Further Troubleshooting Steps

Client Area Only

If the admin area is loading correctly and only the client area is blank, the template folder may be missing or the /templates_c folder may have an invalid path or may not be writeable.

To resolve this:

  1. Re-select the template at Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings and click Save Changes.
  2. Ensure that the templates_c folder has the appropriate permissions and is writeable by the script (usually CHMOD 755, but in some environments may require CHMOD 777).
  3. If the /templates_c directory has been moved to a custom location, ensure the path is correct in the configuration.php file. For help, contact your hosting provider or system administrator.

Admin Login Page Only

The admin login page does not use templates, so a blank page indicates a problem with the ionCube configuration on your server.

To find more troubleshooting information:

  1. Download the ionCube Loader® Wizard.
  2. Upload it to the whmcs directory.
  3. Visit it in your browser.

For help resolving any errors, contact your hosting provider or system administrator.

If it reports that ionCube Loader is installed correctly, ensure that display_errors is enabled in the server's PHP configuration. This can suppress WHMCS error messages with the display_errors line in the configuration.php file.

Problematic custom widgets may also cause a blank page. Try removing any non-standard files from the /modules/widgets directory.

Oops! or Blank Pages Elsewhere

If blank pages are occurring on all pages, try all the above steps, particularly enabling display_errors. If the problem persists, review any custom files in the following locations and ensure there are no blank spaces or carriage returns outside the <?php and ?> tags:

  • /configuration.php
  • /includes/hooks/
  • /modules/admin/
  • /modules/addons/
  • /modules/registrars/
  • /modules/servers/
  • /modules/widgets/
  • /lang/
  • /lang/overrides/
  • /admin/lang/
  • /admin/lang/overrides/

It may be necessary to remove any custom files from these locations temporarily, if doing so resolves the issue then you can add them back one-by-one until the problem re-occurs, you can then contact the vendor of the offending file for a fix.

If none of the steps on this page fix the problem, contact our support team with a description of the troubleshooting you have done, reproduction instructions, and FTP/SFTP access.