Difference between revisions of "PHP 7 Migration Troubleshooting Guide"

From WHMCS Documentation

(Enabling From The Admin Area)
Line 1: Line 1:
 
[[PHP 7 Migration Guide|« Back to the PHP 7 Migration Guide]]
 
[[PHP 7 Migration Guide|« Back to the PHP 7 Migration Guide]]
  
If following a change of PHP version you encounter an Oops error page, or blank or partially rendered page, the most likely cause is that there is a file present in your installation that is not compatible with the new PHP version.
+
If, after changing your PHP version, you encounter an '''Oops''' error or a blank or partially-rendered page, it is likely that there is a file in your installation that is not compatible with the new PHP version.
  
Possible causes include:
+
This may indicate one of these problems:
  
* Syntax Error - A file uses deprecated or removed functionality which is no longer available in the newer version of PHP.
+
* Syntax Error A file uses deprecated or removed functionality that is no longer available in the newer version of PHP.
* Decoding - A file is encoded with an ionCube encoding that is not compatible with the newer version of PHP or the installed ionCube Loader extension.
+
* Decoding A file is encoded with an ionCube® encoding that is not compatible with the newer version of PHP or the installed ionCube Loader® extension.
  
To confirm the exact cause of the issue, you will need to enable error reporting.
+
To confirm the exact cause of the issue, you must enable error reporting.
  
 
==Enabling Error Reporting==
 
==Enabling Error Reporting==
  
 
===Enabling From The Admin Area===
 
===Enabling From The Admin Area===
If you can login to the admin area and navigate to '''General Settings''' then follow these steps below to enable error display.  After enabling Display Errors, retry the steps that previously led to the "Oops!", blank, or partially rendered page and further error information should be displayed.
 
  
# Navigate to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > General Settings > Other''' or, prior to WHMCS 8.0, '''Setup > General Settings > Other'''.
+
If you can log in to the Admin Area and navigate to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > General Settings''', use these steps to enable error display:
# Tick the '''Display Errors''' checkbox located towards the bottom of the page
+
 
# Click Save Changes
+
# Go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > General Settings''' or, prior to WHMCS 8.0, '''Setup > General Settings'''.
 +
# Select the '''Other''' tab.
 +
# Check '''Display Errors'''.
 +
# Click '''Save Changes'''.
 +
 
 +
After error reporting is enabled, retry the steps that previously led to the '''Oops!''', blank, or partially rendered page. More information will display.
  
 
===Enabling From Your Configuration File===
 
===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, below any other statements (but right before the closing PHP tag ''?>'', if present).
+
If you cannot log in, use these steps to enable error reporting in the configuration file directly:
  
<div class="source-cli">
+
# In the WHMCS root directory, edit the <tt>configuration.php</tt> file.
 +
# Add these lines at the end of the configuration file, below any other lines but above the closing <tt>?></tt> line, if it is present:<div class="source-cli">
 
$display_errors = true;
 
$display_errors = true;
 
</div>
 
</div>
  
After adding this line 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.
+
After error reporting is enabled, retry the steps that previously led to the '''Oops!''', blank, or partially rendered page. More information will display.
  
 
==Common Errors/Resolutions==
 
==Common Errors/Resolutions==
  
With error reporting enabled, you should see the full error message being generated at the time the problematic PHP file is attempted to be included/executed.  Below are some of the most common errors you may encounter.
+
With error reporting enabled, you should see the full error message that WHMCS generates when the problem occurs.  
  
 
===Oops! Something went wrong and we couldn't process your request===
 
===Oops! Something went wrong and we couldn't process your request===
Line 38: Line 42:
 
[[File:Oops_error_page.png]]
 
[[File:Oops_error_page.png]]
  
Seeing an error page like the one pictured above indicates a fatal error is occurring.
+
This indicates that a fatal error is occurring. Usually, this is due to these causes:
  
Two of the most common causes are listed below:
+
* '''Missing PHP Extensions''' — You may see this error if your version of PHP is missing some of the [[System_Environment_Guide#Extensions_2|required extensions]] for WHMCS.<div class="docs-alert-warning">If you compile PHP using EasyApache, you must include both the '''PDO''' and '''mysqlnd''' PHP extensions to allow MySQL® connections.</div>
 +
* '''Incompatible PHP Files''' — PHP files using deprecated or unavailable functions may trigger an error page. To debug this, enable error reporting to find the file and PHP error output.
  
* '''Missing PHP Extensions''' - You may see this error if the version of PHP you switched to is missing some of the [[System_Environment_Guide#Extensions_2|required extensions]] for WHMCS. Required extensions include: IonCube Loader, PDO, PDO_MYSQL, cURL with SSL Support, GD2 & IMAP.<div class="docs-alert-warning">Please note that if you are compiling PHP using EasyApache, be sure to include both the '''PDO''' and '''mysqlnd''' PHP extensions for MySQL connections to be possible.</div>
+
===The file was encoded by the ionCube Encoder for PHP x.x and cannot run...===
  
* '''Incompatible PHP Files''' - PHP files using deprecated or non-longer available functions may also trigger an error page such as this. To debug these types of issues, follow the instructions above to enable error reporting and a more detailed error output should be provided indicating the file and PHP error output.
+
You may see an error message that looks like this:
 
 
===The file was encoded by the ionCube Encoder for PHP x.x and cannot run...===
 
  
You may see an error message that looks like this:<br>
+
The file /path/to/file.php was encoded by the ionCube Encoder for PHP 5.6 and cannot run under PHP 7.1 or later. Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 7.1.
''The file /path/to/file.php was encoded by the ionCube Encoder for PHP 5.6 and cannot run under PHP 7.1 or later. Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 7.1.''
 
  
Seeing the above error message indicates the itemised file was encoded using an older version of ionCube Encoder that does not include support for PHP 7.1 or later. You will need to contact the original vendor/author of the file to ask for an updated version of the file.
+
Seeing the above error message indicates that the file was encoded using an older version of ionCube Encoder® that does not include support for PHP 7.1 or later. Contact the original author of the file for an updated version.
  
If the file is a WHMCS file (you can determine this by looking at first several lines of the file for the WHMCS copyright notice), it is possible that it is a file that we no longer maintain or distribute. Typically these files are removed automatically by the update routines built into WHMCS, but if at any time permissions did not allow for its removal, it is possible for it to remain on your system.  In most cases such files are no longer in use or valid for the current version of WHMCS. If it relates to a module that you do not use, it should be safe to simply delete it.  If you are unsure, our support team will be able to assist you in making this determination.
+
If the file is a WHMCS file, we may no longer maintain or distribute it.
 +
* You can identify WHMCS files by checking for the WHMCS copyright notice at the beginning of the file.
 +
* Typically, built-in routine updates remove these files automatically. However, permissions issues may prevent removal.
 +
* Normally, these files are not in use by the current version of WHMCS and you can delete them.
 
   
 
   
 
[[PHP 7 Migration Guide|&laquo; Back to the PHP 7 Migration Guide]]
 
[[PHP 7 Migration Guide|&laquo; Back to the PHP 7 Migration Guide]]

Revision as of 20:32, 28 September 2021

« Back to the PHP 7 Migration Guide

If, after changing your PHP version, you encounter an Oops error or a blank or partially-rendered page, it is likely that there is a file in your installation that is not compatible with the new PHP version.

This may indicate one of these problems:

  • Syntax Error — A file uses deprecated or removed functionality that is no longer available in the newer version of PHP.
  • Decoding — A file is encoded with an ionCube® encoding that is not compatible with the newer version of PHP or the installed ionCube Loader® extension.

To confirm the exact cause of the issue, you must enable error reporting.

Enabling Error Reporting

Enabling From The Admin Area

If you can log in to the Admin Area and navigate to Configuration () > System Settings > General Settings, use these steps to enable error display:

  1. Go to Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings.
  2. Select the Other tab.
  3. Check Display Errors.
  4. Click Save Changes.

After error reporting is enabled, retry the steps that previously led to the Oops!, blank, or partially rendered page. More information will display.

Enabling From Your Configuration File

If you cannot log in, use these steps to enable error reporting in the configuration file directly:

  1. In the WHMCS root directory, edit the configuration.php file.
  2. Add these lines at the end of the configuration file, below any other lines but above the closing ?> line, if it is present:

$display_errors = true;

After error reporting is enabled, retry the steps that previously led to the Oops!, blank, or partially rendered page. More information will display.

Common Errors/Resolutions

With error reporting enabled, you should see the full error message that WHMCS generates when the problem occurs.

Oops! Something went wrong and we couldn't process your request

Oops error page.png

This indicates that a fatal error is occurring. Usually, this is due to these causes:

  • Missing PHP Extensions — You may see this error if your version of PHP is missing some of the required extensions for WHMCS.
    If you compile PHP using EasyApache, you must include both the PDO and mysqlnd PHP extensions to allow MySQL® connections.
  • Incompatible PHP Files — PHP files using deprecated or unavailable functions may trigger an error page. To debug this, enable error reporting to find the file and PHP error output.

The file was encoded by the ionCube Encoder for PHP x.x and cannot run...

You may see an error message that looks like this:

The file /path/to/file.php was encoded by the ionCube Encoder for PHP 5.6 and cannot run under PHP 7.1 or later. Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 7.1.

Seeing the above error message indicates that the file was encoded using an older version of ionCube Encoder® that does not include support for PHP 7.1 or later. Contact the original author of the file for an updated version.

If the file is a WHMCS file, we may no longer maintain or distribute it.

  • You can identify WHMCS files by checking for the WHMCS copyright notice at the beginning of the file.
  • Typically, built-in routine updates remove these files automatically. However, permissions issues may prevent removal.
  • Normally, these files are not in use by the current version of WHMCS and you can delete them.

« Back to the PHP 7 Migration Guide