How to upgrade PHP on cPanel without breaking your website
8 min read · 30-Dec-2025
villagehosting.in team
30 December 2025
PHP 7.4 reached end of life in November 2022. PHP 8.0 reached end of life in November 2023. Running outdated PHP exposes you to unpatched security vulnerabilities. Here is how to upgrade safely.
Never upgrade PHP on live site without testing first
A PHP version upgrade can break plugins, themes, or custom code that uses deprecated functions. Always test on a staging site (cPanel → Softaculous → Clone or a subdomain copy) before upgrading your production site. The 30 minutes of testing can prevent hours of emergency recovery.
Why you should upgrade PHP
Security: End-of-life PHP versions receive no security patches. Known vulnerabilities remain permanently unpatched on your server.
Performance: PHP 8.0 is 30–40% faster than PHP 7.4 on WordPress workloads. PHP 8.1 and 8.2 continue this trend. A PHP upgrade alone can reduce your page load time measurably.
Compatibility: Increasingly, plugins and themes require PHP 8.0+. Staying on 7.4 limits which software you can use.
PHP versions in 2026
| Version | Status | Action |
|---|---|---|
| PHP 7.4 | End of life Nov 2022 | Upgrade urgently |
| PHP 8.0 | End of life Nov 2023 | Upgrade urgently |
| PHP 8.1 | Active support until Nov 2024, security support until Dec 2025 | Upgrade recommended |
| PHP 8.2 | Active support until Dec 2025, security support until Dec 2026 | Acceptable |
| PHP 8.3 | Current stable | Recommended for new sites |
Target PHP 8.2 or 8.3 for production. Avoid 7.4 and 8.0 entirely.
Step 1: Check your current PHP version
In cPanel:
- Go to Software → MultiPHP Manager
- Your current PHP version is shown next to each domain
Or check in WordPress:
- WordPress admin → Tools → Site Health
- Click "Info" tab → Server section → PHP version
Step 2: Check plugin and theme compatibility
This is the most important step. Most upgrade failures are caused by plugins that do not support the new PHP version.
Option A: WP Health Check plugin (recommended)
- Install "WP Health Check" plugin from the WordPress repository
- Go to Tools → Site Health → Info → PHP and check for any notices
- The plugin also shows compatibility issues for active plugins
Option B: Check the WordPress.org plugin pages
For each active plugin, go to WordPress.org/plugins/pluginname and check the "Tested up to" and "Requires PHP" fields.
Option C: Check your host's PHP upgrade tool
Some cPanel hosts include a PHP compatibility checker. In VillageHosting, go to your portal → service → PHP Manager → Compatibility Check.
What to do if a plugin is incompatible
- Check if there is a newer version of the plugin that supports PHP 8.x
- If the plugin is abandoned (no updates in 2+ years), it is time to replace it
- Do not stay on outdated PHP to preserve an outdated plugin — find an alternative
Step 3: Test the upgrade on staging first
Never upgrade PHP directly on your live site.
Create a staging environment
- In cPanel, go to Subdomains → Create
staging.yourdomain.com - Or use your host's staging tool if available
Clone your site to staging
Using a plugin like "Migrate Guru" or "All-in-One WP Migration":
- Install the plugin on your live site
- Export and import to the staging domain
- Update
wp-config.phpon staging with the staging database credentials
Change PHP version on staging only
- cPanel → MultiPHP Manager
- Find the staging domain
- Change to PHP 8.2 or 8.3
- Save
Test thoroughly on staging
Visit every important page and function:
- Homepage and key landing pages
- WordPress admin dashboard
- Checkout (if WooCommerce)
- Contact forms
- Search results
- User login and account pages
- Any custom functionality
Check the PHP error log for warnings:
- cPanel → Errors (in the Metrics section)
- Or in WordPress: enable
WP_DEBUG_LOGin wp-config.php temporarily
PHP 8.x is stricter than 7.x. Some older code produces warnings in 8.x that it silently ignored in 7.4. Most warnings do not break functionality but are worth investigating.
Step 4: Upgrade the live site
Once staging tests pass:
- Take a full backup of your live site first (cPanel → Backup Wizard → Full Backup)
- Enable maintenance mode if possible
- cPanel → MultiPHP Manager → change your live domain to PHP 8.2 or 8.3
- Test your live site immediately — all the same pages you tested on staging
Step 5: Roll back if needed
If something breaks:
- cPanel → MultiPHP Manager → change back to the previous PHP version
- Everything returns to exactly how it was
- The PHP version change is instant and reversible
Investigate the error log to understand what broke, fix the incompatible plugin or code, and try again.
Upgrading PHP without cPanel
If you have a VPS without cPanel:
For Ubuntu with Apache:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2 php8.2-fpm php8.2-mysql php8.2-curl php8.2-gd php8.2-mbstring php8.2-xml php8.2-zip
Update your Apache virtual host or NGINX config to use the new PHP-FPM socket. Test in staging first using a vhost that points to the same files with a different PHP-FPM pool.
Common errors after upgrading
"Fatal error: Call to undefined function": A plugin is using a function removed in PHP 8.x (common with old extensions using deprecated functions). Update the plugin.
"Parse error: syntax error": A plugin contains code with syntax not valid in PHP 8.x. Update or replace the plugin.
"Warning: Array and string offset access syntax": $var{0} syntax is removed in PHP 8.0. Old code that uses it will show a warning or fatal error depending on context. Update the plugin.
Blank white screen (white screen of death): Usually a fatal error. Enable WP_DEBUG_LOG and check the log file at wp-content/debug.log.
After upgrading
- Check Google Search Console for any crawl errors that appeared after the upgrade
- Run PageSpeed Insights — you should see a small improvement in TTFB from the faster PHP
- Disable WP_DEBUG_LOG once you are satisfied everything is working
- Remove the staging site if you no longer need it
A PHP upgrade to 8.2 or 8.3 is one of the highest-impact, lowest-effort performance and security improvements you can make to a WordPress site.