PHP Versions
PHP versions matter for two reasons: security support and compatibility with your theme/plugins. Performance gains from a version bump are usually incremental compared to OPcache, caching, and database tuning, but staying on a supported version is non-negotiable for a production site.
- Prefer the latest PHP version that your WordPress stack supports.
- Upgrade via staging first, validate critical flows, then roll out to production.
- Verify required extensions after the upgrade (imagick/gd, curl, mbstring, redis, etc.).
Pick a Target Version
Use these rules to pick a version that stays secure without breaking your stack.
Version Selection Directives
- Default: Latest Supported
- Compatibility: One Version Behind
- Avoid: End-of-Life Versions
Choose the newest PHP version that is:
- Supported by your OS/distribution packages (or hosting panel).
- Supported by WordPress core and your critical plugins.
Benefits: ongoing security patches, small runtime improvements, and better long-term maintainability.
If your stack has a blocker (a payment gateway, a membership plugin, a custom theme), choose the previous still-supported version as an interim step.
This often reduces risk while you plan plugin/theme updates.
Do not run versions that are end-of-life (EOL).
- No security patches.
- Increasing incompatibility with modern plugins.
- Harder incident response when something breaks.
Upgrade Workflow (Safe)
- Clone to staging: same theme/plugins, similar PHP extensions, copy of the database.
- Switch PHP version on staging: in your panel or package manager.
- Smoke-test critical flows:
- Homepage and a few content templates
- Login + wp-admin
- WooCommerce cart/checkout/account (if applicable)
- Cron jobs / background tasks
- Check logs: look for fatal errors, warnings, and deprecations.
- Plan rollback: know how to switch back quickly if needed.
- Roll to production: during a low-traffic window.
Common Mistakes & Troubleshooting
| Configuration Failure | Operational Symptom | Remediation Protocol |
|---|---|---|
| Upgrading without staging | Fatal errors or white screens on production. | Upgrade on staging first, update/replace incompatible plugins, then roll out. |
| Missing extensions after upgrade | Images, HTTP requests, or Redis stop working. | Verify extension packages for the new PHP version (imagick/gd, curl, mbstring, intl, redis, etc.). |