Upgrading your website to a modern PHP version (such as PHP 8.1 or 8.2) is essential for security, performance, and keeping up with current web standards.
However, one of the most common issues site owners encounter is an immediate crash—either a
500 Internal Server Error, Critical Error, or a completely blank white screen—right after switching versions, while switching back to an older version (like PHP 7.4) makes the site work normally again.This issue affects all types of websites, including WordPress sites, other Content Management Systems (Joomla, Drupal), and custom-built PHP applications.
This guide explains why this happens, how to pinpoint the exact file causing the issue using Plesk logs, and what steps you or your developer need to take.
Why Does This Happen?
PHP 8 introduced strict syntax rules and completely removed many outdated functions and lax error-handling behaviors that were previously allowed in PHP 7.x.
If your website uses:
- An outdated CMS version (such as an older WordPress core release),
- Plugins or themes that haven't been updated in years, or
- Custom PHP scripts or legacy external libraries written for PHP 5.x or 7.x,
the server cannot process those legacy instructions and will halt execution immediately to protect the server and database from running invalid operations.
Step 1: Temporarily Restore Your Site
If your site is currently showing an error after changing versions, revert it to the last known working version to restore access:
- Log into your Hosting Control Panel (Plesk).
- Go to Websites & Domains → locate your domain → click PHP Settings.
- Select your previous PHP version (e.g., 7.4) from the dropdown and click Apply or OK.
- Confirm your website is back online.
Step 2: Find the Exact Culprit in Your Plesk Logs
You don't have to guess which part of your site is breaking. The web server engine logs the exact file and line number responsible:
- In Plesk, under Websites & Domains, click Logs.
- Click the drop-down menu on the right and ensure Apache error is selected.
- Switch your PHP version back to the newer version in a separate browser tab to trigger the error, then refresh the Logs page.
- Look for log lines starting with
PHP Fatal error:,PHP Deprecated:, orDeclaration of...:
AH01071: Got error 'PHP Fatal error: Uncaught Error: Call to undefined function... in /httpdocs/custom-app/lib.php on line 45'How to Read This Log Entry:
- The Severity (
PHP Fatal error): Indicates the script stopped completely because the function or syntax is unsupported in PHP 8.
The File Location: Tells you whether the issue is WordPress-related or custom code:- WordPress Plugins/Themes: Paths containing
/wp-content/plugins/or/wp-content/themes/mean a specific add-on is outdated.
- Custom PHP / Non-WordPress: Paths pointing directly to files like
index.php, custom directories (e.g.,/scripts/,/lib/), or CMS paths like/modules/mean an independent script or custom-coded application contains outdated syntax.
- The Line Number (
on line XX): The exact line in the file where the code broke.
Step 3: How to Resolve the Compatibility Issue
Depending on the type of website you run:
For WordPress Sites:
- Update Everything: Update WordPress core, active themes, and all plugins to their latest versions.
- Isolate Problem Plugins: If a specific plugin is flagged in the log and has no updates available, deactivate or replace it with a modern alternative.
For Custom PHP & Non-WordPress Sites:
- Provide the Log to Your Developer: Copy the exact file path, error line, and function name from Plesk and hand it to your web developer.
- Refactor Deprecated Code: Common PHP 8 fixes include adding missing function arguments (such as in
parse_str()), updating non-static class calls, and modernizing array handling.
Support Scope Notice
Our Customer Support team is always here to help you switch PHP versions, restore site availability, or help you locate your error logs in Plesk. However, because our team manages the hosting infrastructure and server operations, we are unable to write, debug, or rewrite custom website code, custom PHP scripts, themes, or third-party plugins. Code-level remediation must be completed by the website owner or an authorized web developer.
Comments
0 comments
Please sign in to leave a comment.