← All migration guides

MIGRATION GUIDE / DECIDE, IMPLEMENT, VERIFY

PHP 7 to PHP 8 Migration: Steps and Checklist

A PHP 7 upgrade checklist covering a supported PHP 8 target, package compatibility, behavior, data checks, deployment and rollback.

Published
Updated

Short answer

Migrating PHP 7 to PHP 8 requires checking package compatibility and verifying equivalent results for critical workflows. This guide uses PHP 8.5 as an assessment target and covers dependency review, data checks and deployment rehearsal.

Which business need should a PHP migration address?

This guide is for teams maintaining a custom PHP application, admin panel, order system or older framework. If the application is a packaged product with plugins, its own upgrade conditions also belong in scope. Preserving working business rules comes before choosing another framework.

Choose acceptance criteria around the business problem the migration should address. Use the following examples to define the scope.

Current problem Migration work Business outcome to verify
An old package blocks updates Resolve dependency and version constraints Critical workflows run on the supported target
Only one person’s machine can publish a release Record installation and deployment steps Another authorized person can reproduce the release
Order totals or reports change unexpectedly Create behavior checks with representative records Agreed totals and state transitions remain correct

Record a baseline for cost and continuity so maintenance effort can be compared.

How should the target and migration environment be prepared?

Do not assume every PHP 8 branch remains supported. At the 14 October 2026 check, PHP 8.5 lists active support through 31 December 2027 and security support through 31 December 2029. PHP 8.4 may be another supported option, depending on packages and hosting. Recheck the dates when approving deployment. PHP support table

Prepare the source, dependency lock file, extension inventory, web and command-line settings, scheduled jobs and representative test data. Use an isolated environment and a tested restoration path. Agree acceptance for the workflows that matter: sign-in, orders, refunds, reports, uploads or other application-specific tasks.

Start with an in-place upgrade when the current structure still meets the need. Moving selected workflows to a separate API may fit tightly coupled systems, but introduces temporary dual-operation work. The PHP hub compares these paths.

What are the steps for migrating to PHP 8?

  1. Freeze the baseline. Record the working code revision, dependency lock and environment settings. Keep representative outputs alongside error records. The deliverable is a reference environment whose behavior can be checked again.
  2. Find dependency blockers. Review Composer constraints, extensions and private packages. composer validate, composer why-not php 8.5 and composer check-platform-reqs on the target help identify issues; none replaces application acceptance tests. Record which packages need updating, replacement or a scope decision. Composer commands
  3. Review the releases being crossed. Read PHP 7.4→8.0 incompatibilities and the intermediate guides up to the target. Reviewing changes in stages does not require deploying unsupported intermediate releases. The PHP 8.5 guide links earlier migration guides. Assign compatibility work to specific code areas. PHP 8.5 migration guide
  4. Preserve behavior before adding features. Keep unrelated product changes out of the migration. Review loose comparisons, error handling and removed functions. PHP 8.0 changes comparisons between numbers and non-numeric strings, so inspect price, status and identifier checks. The deliverable is a set of expected-result tests. PHP 8.0 incompatibilities
  5. Exercise data and integrations together. Compare payment responses, exports, encodings, time zones and files using equivalent representative records. Keep external calls within test endpoints. Obtain an acceptance record and named owner for each critical workflow.
  6. Rehearse deployment and rollback. Assign ownership of sessions, caches, queues and scheduled jobs. If versions share a database, validate writes and schema compatibility. Clarify whether rollback covers code alone or also requires restoring and reconciling data.
  7. Observe a limited cutover. Start with a suitable user or workflow group. Compare errors, data correctness and latency against the baseline conditions. A named owner applies rollback when acceptance limits are breached, then hands over maintenance and update responsibilities after acceptance.

Pre-release checklist

What should you check first when migration errors appear?

Symptom First investigation Shortcut to avoid
Works locally but fails on the server Runtime, extensions and configuration differences Ignoring platform requirements
A particular record changes the result Type, comparison and null behavior Converting everything to strings to conceal the issue
Users appear signed out after release Session store, cookies and routing Recreating every session without understanding the cause
Some operations happen twice Scheduler and queue-consumer ownership Repeatedly rerunning the same work

This table is not an exhaustive compatibility inventory. Packaged applications, frameworks and plugins need their own vendor checks. A clean vulnerability scan is not assurance for the complete application.

When should you seek help?

Clarify scope first if source is missing, production dependencies cannot be reproduced, payment or stock data differs, or rollback’s data effects are unknown. For a legacy health check, start with the application type, critical workflows and known errors. Do not include credentials or client data in an initial message.

What should the first trial produce?

Choose a supported target, record existing behavior, verify dependency and code compatibility separately, then rehearse deployment with data. The contribution of modernization should appear in a maintainable update path and accepted workflows. Use your own costs in the calculator; this guide is not a delivery-time or budget quotation.

VERIFICATION TRAIL

Sources

  1. PHP: Supported Versions ↗

    The PHP Group · 2026-10-14 (accessed; rolling documentation)

  2. PHP 8.0: Backward Incompatible Changes ↗

    The PHP Group · 2026-10-14 (accessed; rolling documentation)

  3. Migrating from PHP 8.4.x to PHP 8.5.x ↗

    The PHP Group · 2026-10-14 (accessed; rolling documentation)

  4. Composer command-line interface ↗

    Composer · 2026-10-14 (accessed; rolling documentation)

FOUNDER

Mert Can Balci

  • Java / Spring Boot
  • Oracle PL/SQL / PostgreSQL
  • JavaScript / React / Next.js

Mert Can Balci is a full-stack developer working on airline software and internal business applications. His work spans services, data flows and interfaces using Java, Spring Boot and Oracle PL/SQL. He graduated from the dual-degree programme at Istanbul Technical University and Binghamton University. His modernization work focuses on preserving business rules, data consistency and everyday usability.

Personal website ↗GitHub ↗LinkedIn ↗

Read our approach →