At WHMCS, we (heart) PHP.
Not only is PHP the most popular and widely used server-side web programming language, used by over 80% of websites
, but it's the language our product is built upon. Its ease-of-use and low barrier to entry make it ideal for an extensible platform like ours that is used by, integrated with and customised by so many users around the world.
That's why when PHP 7 came along, with the promise of up to a 2x increase in performance, along with new features, functionality and improvements that would allow the entire PHP community to write better code, we were very excited.
In this blog post we examine a few of the benefits and reasons you should upgrade to PHP 7, some of the considerations you need to be aware of before upgrading and what we've done to help simplify the transition.
3 Reasons You Should Upgrade to PHP 7 Speed
- It's faster. A lot faster. Official Zend PHP benchmarks
show that PHP 7 allows systems to execute nearly twice as many requests per second in comparison with PHP 5.6. Efficiency
- With its new leaner and more efficient codebase, PHP 7 has significant reductions in memory consumption. Benchmark comparisons have shown a reduction in memory usage by as much as 50% when compared against PHP 5.6. Active Support
- PHP 5.6 and 7.0 both reach end of life in December 2018, giving you just under 9 months to get upgraded. Until then, they will only be receiving security fixes. Furthermore, security fixes to PHP 5.6 and PHP 7.0 are published after PHP 7.1 and PHP 7.2 leading to a longer wait in getting patches. Moving to PHP 7.1 or 7.2 now will ensure your system is in a well-managed position to react to future vulnerability risks.
So PHP 7 is faster, more efficient and actively supported. Upgrading sounds like a no brainer, right? Right. But before you make the switch, here's a few things you should be aware of. WHMCS Compatibility
- Every WHMCS 7.x release has supported at least PHP 7.0. If you wish to run WHMCS on the latest PHP 7.1 or 7.2 however, you will need WHMCS 7.5 or later. Starting in WHMCS 7.5, a newer encoding is used that makes running on PHP 7.1 or 7.2 possible. WHMCS 7.5 is in the final stages of release candidate testing and we expect it to become available under GA next week. Ioncube Loaders
- You will need a version of ionCube Loader installed on your system that is compatible with the PHP version you wish to use. For PHP 7.1 and 7.2, this means you need ionCube Loader v10.1 or later. The latest loaders can be obtained here
. 3rd Party Module Compatibility
- If you have any 3rd party modules, extensions, or custom code installed in your WHMCS system you will also need to make sure that they are compatible with the target PHP version you wish to upgrade to. This typically involves verifying two things:
- PHP Compatibility - You should check with the vendor that any code you use is compatible with the version of PHP you wish to upgrade to. PHP 7 dropped many deprecated functions that must be removed from older code to prevent runtime errors. As well, there are a few notable changes specific to PHP 7.1 and PHP 7.2 that may affect older code.
- ionCube Compatibility - If the 3rd party code you are using is encoded, you also need to ensure it is encoded using an encoder/loader version that supports the target version of PHP you wish to run.
We've built a utility regarding that second point. It will help you verify the compatibility of ionCube encoded files with different versions of PHP.
Accessed via a new option found under Utilities > System
, our PHP Version Compatibility Assessment Tool
is designed to give you transparency for files that you may have deployed over the lifespan of your installation that appear to be ionCube encoded.
You can perform a scan at any time. In just a few short seconds, WHMCS will scan the installation directory, identify any files that appear to be ionCube encoded, and when possible indicate the compatibility with the various supported PHP versions. The aim of this is to help you identify 3rd party code that you may need to investigate or update prior to upgrading to a different PHP version. To learn more about this utility and how it can help you, visit the documentation here
Performing the Upgrade
Once you've verified that your installation and any modules and custom code used within it are compatible with your intended PHP target version, you're ready to perform the upgrade.
We've created a PHP 7 Migration Guide
which contains our recommended 5 step process for upgrading PHP on the server you use for WHMCS.
To ensure you are receiving the best possible experience while using our product, we encourage all our users who are not yet running PHP 7 to start thinking about and planning a migration and upgrade strategy.
With our easy to follow Migration Guide
and the new PHP Version Compatibility Assessment report available in WHMCS 7.5, the risks and downtime from upgrading can be significantly reduced if not eliminated entirely.
And here's one more consideration to leave you with. In addition to the notable performance improvements PHP 7 brings to apps such as WHMCS, with the faster performance and increased efficiency, PHP 7 allows you to host more customers using the same hardware, which can mean a reduction in costs for you.
Liked this article? Share it