PHP 7 Migration Guide

From WHMCS Documentation

Revision as of 13:48, 18 August 2022 by SarahK (talk | contribs) (1. Install ionCube Loader 10.1)

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 to PHP 7.0, 7.1, 7.2, and 7.3.
  • We recommend performing the steps below in the presented order for the best experience and a minimized risk of disruption or downtime.

1. Install ionCube Loader® 10.1

ionCube Loader 10.1 includes support for a bundled encoding feature. This allows us to encode files that are compatible with all currently-supported versions of PHP. WHMCS 7.5 and later require ionCube Loader 10.1.

  • For manual WHMCS updates, make certain that you install the most recent ionCube Loader version before you update.
  • For updates using 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.

2. Upgrade to WHMCS 7.10

WHMCS 7.10 supports all currently-supported versions of PHP. It includes a utility to identify ionCube-encoded custom or third-party code that may not be compatible with newer versions of PHP.

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

3. Run the WHMCS PHP Version Compatibility Utility

The PHP version compatibility utility 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 can find this utility at Utilities > System > PHP Version Compatibility.

4. Assert Compatibility of Custom and 3rd Party Code

PHP 7 removed many deprecated functions and you must remove those from older code in order to prevent runtime errors. Additional changes in PHP 7.1 and PHP 7.2 may also affect 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 with the version of PHP that you want to use. Often, third-party vendors have already released updates to ensure this compatibility.

5. Upgrade PHP

Before you upgrade PHP, make certain that:

  • You have the necessary ionCube Loader version for your target PHP version.
  • You have a version of WHMCS that supports your target PHP version.
  • Any ionCube-encoded custom or third-party code's encoding is compatible with your target PHP version.
  • Any custom or third-party code is compatible with your target PHP version.

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

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

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: March 2020