Help for owners
My site shows errors after the PHP version was changed in Plesk
Short answer
Plesk lets each domain use its own PHP version and handler, and Plesk's documentation says different PHP versions are not 100% compatible. If a site broke after a change, note the old setting and, if you know it, set the domain back to the previous version. Then plan the upgrade properly.
Does this sound like your situation?
- The site shows a white page or a PHP error right after the change.
- The admin area works but some pages fail, or the other way round.
- A shop checkout or contact form stopped working.
- Someone changed the version because the host said the old one was unsafe.
- Nobody wrote down which version it was before.
Why does this happen?
PHP versions are not fully compatible
Plesk's documentation states that different PHP versions are not 100% compatible and that a site built for one version may break on another. Each domain can use a different combination of version and handler, set under Websites and Domains, then PHP.
Confirmed by docs.plesk.com
The handler matters as much as the version
The available handlers depend on the PHP version and the server's operating system. Plesk says the dedicated PHP-FPM handler requires PHP 7.3 or later and uses more OPcache memory.
Confirmed by docs.plesk.com
Old code uses removed features
Older themes and plugins call functions that newer PHP versions removed or changed, which produces fatal errors or warnings.
Technical detail: Replacing each() in code that stopped working on PHP 8
Extensions differ between versions
Each PHP version has its own list of extensions. One that was on for the old version may be missing from the new one.
Technical detail: PHP prints 'Unable to load dynamic library' every time it starts
Custom settings did not move
Plesk allows core php.ini directives to be changed per domain. Memory and time limits set for one version do not follow a site to another version, and Plesk recommends restoring the defaults if a site becomes slow or stops loading after changes to the FPM settings.
Confirmed by docs.plesk.com
What can I do about it today?
- Find out what the setting was beforeAsk whoever made the change which version and handler the domain used. Plesk's activity log or a message from the host may show it.
- Set only the one affected domain backUnder Websites and Domains, open the domain's PHP settings and choose the previous version and handler. Plesk says to try a different version if a site displays incorrectly. Do not change other domains.
- Leave settings alone after thatOnce the site works again, do not tune memory or FPM settings on a hunch.
- Take a backup of files and databaseBefore further tests, ask for a copy so a change that goes wrong can be undone.
- Note the error textCopy the message from the page or the logs. It tells whoever fixes it which feature is missing.
- Ask why the version was changedIf it was for security, the old version still needs a plan. Do not leave it forever.
When should I bring someone in?
- The old version no longer exists on the server.
- A shop or booking system is broken and you do not know the cause.
- The site is old and every version you try produces errors.
How do I handle it?
- Put the site back to a working stateI return the domain to its last working version and handler so customers can use it while the upgrade is prepared.
- Copy the site to a test domainThe upgrade is tried on a copy, never on the live site.
- List what breaks on the new versionI run the copy on the target version, read the logs and list removed functions, missing extensions and changed settings.
- Update or replace the old codePlugins and themes are updated, patched or replaced, and my changes are kept small and written down.
- Switch over with a way backI change the live domain at a quiet hour with a backup and a tested rollback.
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 just go back to the old version?
Often yes, for one domain at a time, if the old version is still installed. It is a stopgap. Old versions stop receiving fixes.
Why did the change break only one site?
Plesk sets the version per domain, and each site's code, extensions and settings differ.
Is this the same as a general PHP upgrade problem?
The causes are similar. This page is about the Plesk setting. The general case is in the page about a PHP upgrade breaking a site.
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
Fatal error: Uncaught Error: Call to undefined function each()Replacing each() in code that stopped working on PHP 8PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/lib/php/20230831/imagick ...)PHP prints 'Unable to load dynamic library' every time it startsDeprecated: 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 null