The latest news from Meantime IT

All Meantime news

PHP Great migration

Meantime IT has been working behind-the-scenes to upgrade to the latest language, security and performance features of PHP 7. Here’s how we managed a complicated migration to ensure our clients had a seamless transition to this vastly more powerful version of PHP.

Here at Meantime there's a lot that goes on behind the scenes to keep your systems up-and-running flawlessly that we don't necessarily shout about, as it all gets a bit technical. But we’re constantly working to ensure that your systems are supported by the best and most reliable technology available.

You will all (probably!) know about our backup strategy and our recent move to a truly world-class hosting platform at Rackspace with tier 1 connectivity access. The built-in fail-over means that, if the server(s) went down, your system would automatically start up on a new mirrored server with no loss of service. There are also many server patches that we apply to one of Red Hat Linux, PHP, MySQL, or the Apache web service; these are installed using our normal rigorous change management process, adhering to our ISO27001 policies and ensuring that the server running your software is protected against the latest threats.

What you won't be aware of is that each component running on that server has a finite lifespan, much like versions of Windows or iOS, and, even with our extended commercial support licences, sometimes we have to upgrade our core platform before it reaches end-of-life. And so, recently we embarked on one of our most ambitious upgrades from PHP 5.2 (for some clients) to PHP 5.3 and then PHP 7.0.

PHP is the language we use to craft your software; it’s open-source, highly popular and very robust. However, much like actual language, over time it changes. When we decided to embark on the PHP move (known internally to us as the PHP Great Migration, or PGM for short), we had a major hurdle - there were three potential versions of PHP and only two servers to test and deploy to, so we decided to make the move in stages.

Firstly, and the target for Q1 and Q2 2016, was to get everyone moved from PHP 5.2 to PHP 5.3. This was more of an undertaking than it first appears - the language differences between these two versions was very large and, at the same time, we also upgraded the MySQL language version to be compatible with PHP 5.3, which meant for a large number of systems rewriting every query in that system. Once rewritten, we tested and then deployed to live. This approach allowed us to 'drain' a server so it no longer had any projects on it. Happily, we now no longer run any PHP 5.2 and this stage of the migration was complete.

Now that this server was empty, we could install PHP 7.0. What happened to the other versions of PHP 5 or PHP 6, I hear you ask? Well, PHP 5 was already coming up to its end-of-life cycle in a couple of years and as for PHP 6, well, as it’s open source, it was started and then abandoned for PHP 7. So, with PHP 7 giving us the longest shelf life and at least a further decade of support, the decision was taken to move to that.

Our targets for Q3 and Q4 are to now take all of our client base on PHP 5.3 and repeat the process to get them running on PHP 7. Linguistically, this poses far fewer challenges except for one - the connector that PHP uses to access the MySQL database has been removed in PHP 7, meaning no database access. Rather than attempt to rewrite every query again (in excess of 50,000), we decided on a different approach – make our own custom versions of the deprecated MySQL connection functions. With these in place, we will simply include our versions that translate to the new connector (PDO), meaning all queries can stay in place. This part of the move is happening gradually over the next 6 months but already, some clients will be (invisibly) taking advantage of the latest language, security and performance of PHP 7.

And now you know why we don't shout about these things very often - they really are rather technical!

Because everything we build is bespoke, you might not see exactly what you need. If that’s the case please get in touch. We'd be happy to discuss how we can help you to take the first step to cutting costs and growing beyond all expectations.