Difference between revisions of "PHP Migration Guide"

From WHMCS Documentation

Line 27: Line 27:
 
   
 
   
 
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.
 
 
Click '''Scan Now''' to resolve the issue and report compatibility correctly.
 
</div>
 
  
 
== Assert Compatibility of Custom and Third-Party Code ==
 
== Assert Compatibility of Custom and Third-Party Code ==

Revision as of 19:29, 6 October 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.

Upgrade ionCube® Loader

ionCube Loader includes support for a bundled encoding feature that WHMCS uses to encode its files.

If you use the Automatic Updater, WHMCS will not allow you to begin upgrading WHMCS until you are using the necessary version of ionCube Loader. 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.

Upgrade WHMCS

Upgrade WHMCS to a version that supports your desired version of PHP. You can do this using the Automatic Updater at Utilities > Update WHMCS or by performing an update manually.

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 that 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.

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.

Additional Updates

After upgrading PHP, you may need to update your configuration to reflect the change. These changes depend on the configuration you choose for your WHMCS installation and any customizations that you use. For example, some WHMCS installations may require updates to the cron configuration and editing the cron's 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, reverting to the previous PHP version should allow you to regain access to the WHMCS system.

Last Updated: October 2022