Retiring an old PHP version on a shared box without breaking someone's checkout

Steve32

Premium Member
Premium
Registered
Joined
Mar 15, 2014
Messages
137
Points
18
Running several PHP versions on one box and trying to work out a sane way to retire the oldest one. Every site still pinned to it has to be moved by hand, and at the moment I find out something broke when the client emails me, which is the wrong order.

What I do per site is run the codebase through a compatibility check and move it on a staging domain first. That works and does not scale past a few sites. The ones that worry me are old WordPress installs with abandoned plugins, where the fatal only fires on a path nobody visits until someone tries to check out.

The approach I have drifted towards is switching the site, watching the PHP error log filtered to that domain for a week, and rolling back on the first fatal rather than trying to predict them in advance. It feels backwards, but it finds the code paths that testing does not reach. What I lose is the client hitting the error before I do.

For anyone running a mixed box, do you set a date and move everyone whether they are ready or not, or keep the old version alive until the last site leaves it? And has anyone found a way to work out which sites will break that beats just running them and waiting?
 

Chris Worner

Well-known member
Registered
Joined
Apr 15, 2016
Messages
635
Points
28
Set the date, but move the sites in order of how much you will regret being wrong. Anything with a checkout goes last and gets the staging pass properly. Brochure sites go first in a batch, because if one throws a fatal you find out on a page nobody was buying from.

On predicting it, static analysis against the target version gets further than people give it credit for, but only if you point it at the plugin and theme directories rather than the application. The fatals I have hit were all in abandoned plugin code, never in WordPress itself. What it will not catch is anything using a removed extension, since that shows up as a call to an undefined function and looks identical to a thousand harmless dynamic calls. I check the loaded extension list per site separately for that reason.
 

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top