Difference between revisions of "PHP 7 Migration Guide"

From WHMCS Documentation

(Created page with "Here's our 5 step guide for how to upgrade the PHP version your site hosting WHMCS is running. This guide applies to upgrades from any earlier PHP version to PHP 7.0, 7.1 or...")
 
(2. Upgrade to WHMCS 7.5)
Line 16: Line 16:
  
 
WHMCS 7.5 supports all currently supported versions of PHP, giving you the widest choice of PHP Versions. It also includes a utility designed to help you identify any custom or 3rd party code that is not ionCube compatible.
 
WHMCS 7.5 supports all currently supported versions of PHP, giving you the widest choice of PHP Versions. It also includes a utility designed to help you identify any custom or 3rd party code that is not ionCube compatible.
 +
 +
Running WHMCS 7.4 or earlier will only allow you to upgrade to PHP 7.0.x.
 +
 +
For a full index of PHP compatibility by WHMCS Version, please refer to the [[System Environment Guide#PHP|PHP Compatibility Guide]].
  
 
==3. Run the WHMCS PHP Version Compatibility Utility==
 
==3. Run the WHMCS PHP Version Compatibility Utility==

Revision as of 10:29, 29 March 2018

Here's our 5 step guide for how to upgrade the PHP version your site hosting WHMCS is running.

This guide applies to upgrades from any earlier PHP version to PHP 7.0, 7.1 or 7.2.

By following the steps below (in order), in most cases this will allow you to make the transition with minimal disruption or downtime to your system or workflows.

1. Install Ioncube Loader 10

ionCube Loaders 10.1 include support for the new bundled encoding feature from ionCube that makes it possible to encode files in a way that is compatible for all currently supported versions of PHP.

If you plan to update WHMCS manually, you will need to ensure you have the latest loaders from ionCube installed before starting.

If you are using the automatic updater, you don't need to do anything. The WHMCS update utility will ensure you have the necessary version of ionCube before beginning, and alert you if not.

2. Upgrade to WHMCS 7.5

WHMCS 7.5 supports all currently supported versions of PHP, giving you the widest choice of PHP Versions. It also includes a utility designed to help you identify any custom or 3rd party code that is not ionCube compatible.

Running WHMCS 7.4 or earlier will only allow you to upgrade to PHP 7.0.x.

For a full index of PHP compatibility by WHMCS Version, please refer to the PHP Compatibility Guide.

3. Run the WHMCS PHP Version Compatibility Utility

Accessed via the Utilities > System menu in WHMCS 7.5 and later, this tool will provide an assessment of all the files present in your WHMCS installation and identify any files which are suspected of being encoded with an ionCube encoding that is not compatible with your desired target PHP version.

4. Assert Compatibility of Custom and 3rd Party Code

PHP 7 dropped many deprecated functions that must be removed from older code to prevent runtime errors.

For any code you have authored, you will need to manually verify this. For any code you use from 3rd party vendors, you should check with the vendor that any code you use is compatible with the version of PHP you wish to upgrade to. In many cases, you may find that 3rd party vendors have already released updates that are designed to ensure compatibility with newer PHP versions.

5. Upgrade PHP

If you've completed steps 1-4, you should now have asserted the following:

  • That you have the necessary ionCube loaders for your target PHP version
  • That you have a version of WHMCS that supports your target PHP version
  • That any custom or 3rd party code that is encoded with ionCube is encoded in such a way as to be compatible with your target PHP version
  • That any custom or 3rd party code is compatible with your target PHP version

With all of those completed, you can now proceed to upgrade the PHP version your site is running.

If you're running cPanel and EasyApache 4, you can switch the version of PHP your site is running using the MultiPHP selector feature found inside your cPanel control panel.

If after upgrading, you experience any of the following when visiting any URL within WHMCS or performing specific actions, this indicates that your system or some custom or 3rd party code has an incompatibility with the new PHP version.

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

Please see our PHP 7 Migration Troubleshooting Guide for steps to debug and resolve these issues.

For an immediate solution, reverting to the previously installed and used PHP version should allow you to re-gain access to the WHMCS system.

    • Last Updated: March 2018**