PHP 7.0 was released in December 2015 amidst great fanfare and controversies. This was a monumental event for the PHP community because the last popular version, PHP 5.6.x was already showing its age.
The community welcomed the new version because of the massive improvements in the core language and the consequent ecosystem of frameworks. In general, the new version promised increased speed, a more streamlined development process, and overall performance related improvements.
An important benefit of PHP 7 is the enhanced error handling mechanism that removes much of the hassles that developers face when working with PHP 5.6. In particular, fatal errors in PHP 7 will not stop the execution of the rest of the script. In practical terms, this means that PHP 7 does not result in a blank screen because of a single fatal error.
Porting PHP 5.6 code to PHP 7 is already a major challenge for PHP community. Since PHP 5.6 powers a lot of popular websites on the internet today, this challenge attains special significance. In many cases, major frameworks and libraries have already started rolling out incremental releases that update existing code to PHP 7.x.
Given all this, it is important that hosting solution providers consider upgrading their infrastructure to PHP 7. This is an important move for PHP development community because the support for the PHP 5.6 could end in the coming years.
To understand this issue, I went to the community to discover whether the hosting solution providers should upgrade to PHP 7. I created questions on Quora, Reddit and hosting forums and got interesting replies which are justified technically and for business purposes. The pleasant thing is developers are encouraging to upgrade to PHP 7 which is no doubt the best version anyway.
Lets see what the Quora community has to say on the topic:
A Quora user and experienced web developer Mahendra Sharma replied with a mixed opinion for both PHP versions:
“PHP 5.6 is a stable version of PHP which is compatible with almost all machines.
Most of the web hosts use Linux machines for web hosting purposes.
Hosting providers still uses PHP 5.x because it requires less memory .
They only use PHP 5 on shared hosting accounts. On VPS and dedicated servers, you are free to upgrade to any version of PHP 7 or 7.1 .
I am using PHP 7.1 on my VPS . I started with PHP 5.5.9 and upgraded to PHP 7.1 with a consequent doubling of the speed .
By default my hosting package comes with Apache2 , PHP5 , MySQL5 and phpMyadmin2.
If you have purchased a shared plan ,you are restricted to default versions and configuration. If you are on VPS or on dedicated servers ,you are free to use any technology and software .
The main reason of using Apache2 , PHP5 and MySQL5 is that these softwares consume less CPU resources and energy.”
Another Quora user; Lee Stolz has given a business oriented opinion:
“They [developers] are still using PHP 5.x because they know that it still works for their customers. It also requires time and energy to upgrade and test. Some will probably wait until customers start getting upset before they bother to upgrade.”
Gaurav Sharma responded by:
Because they [developers] are reluctant in spending time and resources for upgrading that, as upgrading would require calling all clients to check for the compatibility issues and a lot more.”
Reddit’s PHP community offered their (more than) two cents on the topic:
Reddit user Tiquortoo was in favour of PHP 5.6 on hosting providers and said:
“5.6 has security support until December 2018. There is no inherent security issue with 5.6 just because a new version is out. In fact, it could be argued that a security patch only version has security advantages since new functionality and changes are where most issues are introduced.”
Indeed, I believe he is right about PHP 5.6 is the most stable version uptill now and still has almost one and a half years to go. He also took on the debate from a business-oriented perspective of making customers happy and generating revenue:
You are thinking like a developer. Think like a business. Does PHP 7 make me more money, does it save me money, does it get me more customers, does it make my current customers pay me more money? The answer is likely no for all of those questions except for a very narrow set of apps.
A touch blunt I would say, but I agree with his opinion about the developers’ concern about making money.
For application performance and optimization Reddit user dops said:
“You’re right but hosting companies don’t give a damn about your app’s performance.
In their defence though most companies now run some sort of service so you can change to PHP 7 easily, and IMHO every dev should at one point in their careers upgrade a server.”
From experience I know that not all hosting solution providers prioritized PHP performance and optimization by providing caching and monitoring addons.
Another Redditor domdomdom2 finds the upgrade process of PHP 5.6 to 7.0 groundbreaking:
“Try telling all the mom and pop shops that some web dev did their site 8 years ago on 5.3 that they need to upgrade. When someone comes in and informs them it’s going to cost $500 to go through their code and upgrade, they are going to straight up say no.
Also try being a host, upgrading to 7.0+ and 50% of the sites break because they are using deprecated code. These websites will migrate to another host and you will lose a ton of money.”
I think Anna Filina has given a conference talk recently on how to upgrade a 16 years old code. But _dyvil_ begs to differ:
“They need to support Legacy systems, imagine in-place updating all PHP4 servers with PHP4 code to 7.1.
Do you expect it to work?
If a shared host does that then think about how liable they are to losses to customers?
I understand what you are trying to get at but that’s a perfect world situation you are thinking of. Not a realistic one.
Believe me, I was young once! And I wish it was that easy but if the client does not care even after you tell them they should consider updating. Then you can only say, I told you so.”
Honestly speaking PHP 5.6 does have some serious deprecation issues which have been removed in 7.0. Similarly, the 7.1 upgrade removed some 7.0 deprecations. I believe this can become a hassle when upgrading the PHP code.
This what Reddit user Colinodell had to say about the upgrade process:
“Anything deprecated in PHP 5.6 has been removed in PHP 7. Upgrading a site which uses those deprecated features will cause it to break. It would be extremely irresponsible to make this change without updating the site first. Some hosting clients don’t have the budget to revise/rebuild their site right now, and PHP 5.6 is still a supported version, so there’s no need to rush the upgrade process.
That being said, I do think it’s important that hosting providers offer PHP 7.x as an option to their customers, even if some of them cannot upgrade at the moment.”
Another redditor r0ck0 has a meaningful opinion:
“If you’re a shared hosting provider, and you just upgraded all your old servers to PHP 7, you’d break a lot of sites with code relying on old features and stuff like that. That’s a massive risk compared to the minimal benefits from your customers’ perspective.
Anybody using the new features of PHP 7, will pick a PHP 7 host (or VPS) from the start. So they’re already looking after themselves in that regard.
To use some analogies, imagine if a shared host upgraded from ‘Python 2 to Python 3’, or from ‘PHP 3 to PHP 7’ by default on old servers with old sites/code. That would be mayhem, and they’d lose most of those customers, being that they can’t be relied on for stability.
Well, this is the same, just a less extreme version.
To use another analogy, this is why more people run Debian on servers instead of Arch.
Also there’s the fact that anybody using shared hosting likely doesn’t employ full time developers to keep their code up to date. Almost all companies with developers on hand won’t be using shared hosting to begin with.”
So it seems Redditors in general have serious problems with upgrading PHP 5.x to 7.x and are rather more concerned with performance and optimization of PHP apps.
Next, I went to various hosting focused forums and asked the same questions. I got rather similar replies and thoughts:
The user rankmyhub agreed with the opionions of Rediiters and said:
“Most hosts can upgrade or provide multiple PHP versions for customers. The problem lies at the customer end, where the majority comprises of lay users with little technical knowledge. So for such users, hosting providers would not benefit from upgrading to PHP 7.x.
For upgrades to happen, both the host and customers should agree on the point. Often the customer needs to reinvest on development and hire developers to upgrade their website to work with new PHP version. This is a roadblock, as most of them do not like investing on web development regularly.
We have seen many people who say ” I want to build a website that should work for 4 years at least”. This is the customer way of thinking. Even if you tell them that regular maintenance and upgrades are necessary, they do not care. If you want to work for free, you can work and upgrade the customer website, which is a total loss for developers.
So it takes time and money and is easier said than done with too many real world dependencies. Hope this clarifies your query.”
Many hosting providers think that it is better to provide both PHP versions to the developers and let them make the choice. In this regard VirtuBox said this:
“You can’t ask customers to upgrade their websites or applications. You can offer the choice between PHP 7 and 5.6, but most of users don’t even know the difference between the two.”
Another forum user agrees:
“Many of our clients are using scripts that they did not create themselves. So asking them to upgrade is a tedious task.
A better solution is to provide all versions from PHP 5.6 to PHP 7.1 through MultiPHP in WHM/cPanel”
This was a mashup of varying opinions from the PHP community that (more or less) clears up why hosting providers are still using PHP 5.x versions. Indeed PHP 7.x is better optimized but the ground realities present significant hurdles to the widespread adoption of the version by hosting providers.
What do you think on the issue? Do you think hosting providers should migrate to PHP 7.x? Do leave your answers in the comments section below.
Shahroze is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. He’s always in search of new frameworks and methods to implement them. Besides his coding life, he loves movies and playing soccer with friends. You can email him at email@example.com
Create PHP websites without the worry of server management.
Deploy your PHP app on optimized PHP hosting servers.