← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

PHP Version Upgrade Checklist

php PHP 5.0+ Intermediate

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

Added 23 Mar 2026
Views 17
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S
No pings yet today
No pings yesterday
Amazonbot 6 Google 2 Perplexity 2 ChatGPT 1 Unknown AI 1 Meta AI 1 Ahrefs 1
crawler 13 pre-tracking 1
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

✓ schema.org compliant