PHP Version Upgrade Checklist
TL;DR
A systematic PHP upgrade process: check EOL status, run static analysis, update Composer deps, run Rector, test on new version in staging, then deploy — never upgrade directly in production.
Explanation
PHP upgrade checklist: (1) Check current version EOL at php.net/eol. (2) composer outdated — update dependencies for new PHP version. (3) Run PHPCompatibility PHPCS to find incompatible code. (4) Run Rector for automated migration. (5) Enable E_ALL in dev and fix all notices/warnings/deprecations on current version first. (6) Set up staging environment with new PHP version. (7) Run full test suite. (8) Run with new version in shadow/canary mode. (9) PHP-FPM: update pool config for new version. (10) Monitor error logs after deployment. OPcache: clear after upgrade. JIT: reconfigure if used. Extensions: verify all needed extensions are available in new version.
Common Misconception
✗ You can upgrade PHP directly in production — always test on staging first. PHP upgrades can break framework version requirements, extension APIs, and third-party libraries.
Why It Matters
A structured upgrade process prevents production incidents — PHP version upgrades are the highest-risk maintenance operation for a PHP application.
Common Mistakes
- Upgrading PHP without first fixing all deprecation warnings on the old version.
- Not checking Composer dependency compatibility before upgrading.
- Forgetting to clear OPcache after PHP version change.
Code Examples
✗ Vulnerable
# Dangerous: direct prod upgrade without testing:
sudo apt-get install php8.3-fpm
sudo service php8.0-fpm stop
sudo service php8.3-fpm start
✓ Fixed
# Safe upgrade process:
# 1. Fix deprecations on current version:
php -d error_reporting=E_ALL -d display_errors=1 index.php
# 2. Check deps:
composer check-platform-reqs --php-version=8.3
# 3. Run Rector:
vendor/bin/rector process --dry-run
# 4. Test on staging with new PHP
# 5. Monitor for 24h, then prod rollout
# 6. Clear OPcache after deploy
Tags
🤝 Adopt this term
£79/year · your link shown here
Added
23 Mar 2026
Views
17
🤖 AI Guestbook educational data only
|
|
Last 30 days
Agents 0
No pings yet today
No pings yesterday
Amazonbot 6
Google 2
Perplexity 2
ChatGPT 1
Unknown AI 1
Meta AI 1
Ahrefs 1
Also referenced
How they use it
crawler 13
pre-tracking 1
Related categories
⚡
DEV INTEL
Tools & Severity
🟡 Medium
⚙ Fix effort: High
⚡ Quick Fix
Follow the checklist: fix deprecations → check deps → run Rector → test on staging → deploy → clear OPcache. Never skip the staging step.
📦 Applies To
PHP 5.0+
web
cli
queue-worker
🔗 Prerequisites
🔍 Detection Hints
Auto-detectable:
✗ No
rector
phpcs
phpstan
⚠ Related Problems
🤖 AI Agent
Confidence: Low
False Positives: High
✗ Manual fix
Fix: High
Context: File
Tests: Update