Help for owners
After a PHP upgrade my website shows errors or a blank page
Short answer
Newer PHP versions remove or change old behaviour, so an old site can fail the day the version changes. The quick, safe step is to ask your host to switch back to the previous PHP. Then plan a tested upgrade, because old versions stop receiving security fixes.
Does this sound like your situation?
- My website went blank or shows an error right after my host updated PHP.
- Only some pages fail, such as checkout or the admin area.
- My host says my PHP version is end of life and will be switched off.
- A plugin or theme is no longer supported.
- Nobody remembers which PHP version the site was written for.
Why does this happen?
PHP versions have a limited life
php.net says each release branch gets two years of active support, then two more years of critical security fixes only, and after that it is end of life. It warns users of end of life releases to upgrade as soon as possible.
Confirmed by php.net
Old code uses things newer PHP removed
Features are deprecated and then removed over versions. A site that ran for years can hit a removed feature the day its host changes version.
Technical detail: PHP: array and string offset access with curly braces is deprecated
Warnings became errors
Code that only gave a notice before can now stop the page.
Technical detail: PHP: Trying to access array offset on value of type null
Plugins, themes and libraries lag behind
Third-party code may not support the new version, or may be abandoned.
Technical detail: PHP warns that null is passed to a built-in function
What can I do about it today?
- Ask your host to switch back to the previous PHPMost hosts let you choose the version per site. This is usually reversible and brings the site back.
- Do not edit code or delete plugins to fix itGuesses can turn an error into a lost page or lost data.
- Take a backup before any further changeFiles and database, stored outside the server.
- Write down the exact version and the dateThe version before and after, and when the error began. It saves an engineer hours.
- Note the end-of-life date of the old versionCheck php.net's table, linked below, so you know how long you can stay on the older PHP.
When should I bring someone in?
- Going back does not work or the host will not allow it.
- The site is old and nobody can say what framework it uses.
- The old PHP version is already end of life.
How do I handle it?
- Reproduce the error on a copyI run a copy of your site on the new version and read the error messages.
- Fix what the new version rejectsCode changes are small and focused on what the version no longer accepts.
- Update or replace the old librariesDependencies are upgraded, or replaced where they are abandoned.
- Test, then switch with a rollbackI check key flows on the copy before switching, and keep the old setup available to go back.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Can I stay on the old PHP?
For a while. php.net says an end of life branch is no longer supported and users should upgrade as soon as possible, so it is a short-term step.
How long does an upgrade take?
It depends on the size and age of the code. I give a written scope after reading it.
Will I lose data?
Not if a backup is taken first and the upgrade is tested on a copy.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.
For your developer: the technical fixes
Deprecated: Array and string offset access syntax with curly braces is deprecatedPHP: array and string offset access with curly braces is deprecatedTrying to access array offset on value of type nullPHP: Trying to access array offset on value of type nullDeprecated: Passing null to parameter #1 ($string) of type string is deprecatedPHP warns that null is passed to a built-in functionA white page with no output at all (HTTP 500 in the access log)PHP shows a blank page and no error message