Difference between revisions of "PHP Migration Guide"

From WHMCS Documentation

(Created page with "The version of PHP that the server hosting your WHMCS installation runs is important in order to run WHMCS successfully. <div class="docs-alert-success"> * The steps below a...")
 
Line 25: Line 25:
 
   
 
   
 
We recommend running this utility before any change you make to your system's PHP version.
 
We recommend running this utility before any change you make to your system's PHP version.
 +
 +
<div class="docs-alert-success">
 +
You must perform a new scan after updating. If you do not, you will see the results of the previous scan, which will incorrectly display incompatibility warnings for files that are now compatible with your system.
 +
Performing a new scan will resolve the issue and report compatibility correctly.
 +
</div>
 
   
 
   
 
== Assert Compatibility of Custom and Third-Party Code ==
 
== Assert Compatibility of Custom and Third-Party Code ==
Line 55: Line 60:
 
* If you run cPanel & WHM and EasyApache 4, you can change your website's PHP version using '''[https://docs.cpanel.net/cpanel/software/multiphp-manager-for-cpanel/ MultiPHP Manager]''' in your cPanel control panel.
 
* If you run cPanel & WHM and EasyApache 4, you can change your website's PHP version using '''[https://docs.cpanel.net/cpanel/software/multiphp-manager-for-cpanel/ MultiPHP Manager]''' in your cPanel control panel.
 
* For other control panels or systems, consult the vendor's documentation.
 
* For other control panels or systems, consult the vendor's documentation.
 +
 +
== Update Configurations ==
 +
 +
After upgrading PHP, you will need to update your configuration to reflect the change. Make certain that you update your cron configuration and the cron <tt>php.ini</tt> file.
 
   
 
   
 
== Errors ==
 
== Errors ==

Revision as of 17:49, 13 September 2022

The version of PHP that the server hosting your WHMCS installation runs is important in order to run WHMCS successfully.

  • The steps below apply to upgrades from PHP 5 or higher to later WHMCS-supported versions of PHP.
  • We recommend performing the steps below in the presented order for the best experience and a minimized risk of disruption or downtime.

Install ionCube® Loader

ionCube Loader includes support for a bundled encoding feature that WHMCS uses to encode files that are compatible with all currently-supported versions of PHP. You must install the correct ionCube Loader version for your desired version of WHMCS before you update:

Minimum ionCube® Loader Version by WHMCS Version
WHMCS Version (Status) PHP v5.2 PHP v5.3 PHP v5.4 PHP v5.6 PHP v7.0 PHP v7.1 PHP v7.2 PHP v7.3 PHP v7.4 PHP v8.1
v6.3 (EOL) 4.6.1 4.6.1 4.6.1 4.6.1 -- -- -- -- -- --
v7.0 (EOL) -- -- -- 5.0.21 6.0.2 -- -- -- -- --
v7.1 (EOL) -- -- -- 5.0.21 6.0.2 -- -- -- -- --
v7.2 (EOL) -- -- -- 5.0.21 6.0.2 -- -- -- -- --
v7.3 (EOL) -- -- -- 5.0.21 6.0.2 -- -- -- -- --
v7.4 (EOL) -- -- -- 5.0.21 6.0.2 -- -- -- -- --
v7.5 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 -- -- --
v7.6 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 10.3.1 -- --
v7.7 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 10.3.1 -- --
v7.8 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 10.3.1 -- --
v7.9 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 10.3.1 -- --
v7.10 (EOL) -- -- -- 10.1.0 10.1.0 10.1.0 10.2.0 10.3.1 -- --
v8.0 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.1 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.2 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.3 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.4 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.5 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 --
v8.6 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 12.0.1
v8.7 (EOL) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 12.0.1
v8.8 (LTS) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 12.0.1
v8.9 (LTS) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 12.0.1
v8.10 (Active) -- -- -- -- -- -- 10.2.0 10.3.1 10.4.3 12.0.1

We recommend using the most-recent compatible ionCube Loader version. If you use the Automatic Updater, WHMCS will automatically check for the necessary version of ionCube Loader before beginning the update and alert you if you must update ionCube Loader first.

Upgrade WHMCS

Upgrade WHMCS to a version that supports your desired version of PHP. For a full index of PHP compatibility by WHMCS version, see System Environment Guide.

For a full index of PHP compatibility by WHMCS version, see System Environment Guide.

Run the WHMCS PHP Version Compatibility Utility

The report at Utilities > System > PHP Version Compatibility in WHMCS 7.5 and later can identify ionCube-encoded custom or third-party code may not be compatible with newer versions of PHP.

We recommend running this utility before any change you make to your system's PHP version.

You must perform a new scan after updating. If you do not, you will see the results of the previous scan, which will incorrectly display incompatibility warnings for files that are now compatible with your system. Performing a new scan will resolve the issue and report compatibility correctly.

Assert Compatibility of Custom and Third-Party Code

New PHP versions often introduce changes or remove deprecated functions. These changes can cause issues like runtime errors in older code.

  • Manually verify this in any code that you wrote or customized.
  • Check with third-party vendors to ensure that their code is compatible your desired PHP version. Often, third-party vendors have already released updates to ensure this compatibility.

See PHP's documentation for more information about changes in each PHP version:

Upgrade PHP

Before you upgrade PHP, make certain that:

Then, proceed to upgrade the PHP version your site is running:

  • If you run cPanel & WHM and EasyApache 4, you can change your website's PHP version using MultiPHP Manager in your cPanel control panel.
  • For other control panels or systems, consult the vendor's documentation.

Update Configurations

After upgrading PHP, you will need to update your configuration to reflect the change. Make certain that you update your cron configuration and the cron php.ini file.

Errors

If you experience any of the following error conditions when visiting a URL in WHMCS, there may be compatibility issues with your new PHP version:

  • A 500 internal server error
  • A blank page
  • An oops error page

For help, see PHP 7 Migration Troubleshooting Guide. For an immediate solution, revert to the previous PHP version should allow you to regain access to the WHMCS system.

Last Updated: September 2022