Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Upgrading PHP 5: Use PHP 7 as a Bridge, Not the Destination

Illustrated infographic summarizing: Upgrading PHP 5: Use PHP 7 as a Bridge, Not the Destination

By Greg Nowak. Updated 23 July 2026.

If a business-critical website still runs PHP 5, changing the server version is the easy part. The real work is uncovering everything that depends on the old runtime: abandoned libraries, custom plugins, scheduled jobs, payment integrations, email delivery and code paths nobody has tested recently.

That is why an old request to “upgrade PHP 5 to PHP 7” needs reframing. Every PHP 7 branch is now unsupported; PHP 7.4 reached end of life in November 2022. As of July 2026, the supported branches are PHP 8.2 through 8.5, with 8.2 already limited to critical security fixes until the end of 2026. For most projects, PHP 8.4 or 8.5 should be the shortlist—but the correct target is the newest supported release that the application, hosting platform and required extensions can all run reliably.

First decide whether the system is worth migrating

Before estimating code changes, establish what the application does for the business. A lightly customised brochure site may be cheaper to rebuild on a maintained platform. A bespoke ordering, membership or operational system may justify a staged migration because its business rules are difficult to reproduce safely.

Record the current PHP version, web server, operating system, database, enabled extensions, CMS or framework version, Composer packages, custom modules, cron jobs, queues and external integrations. Include the people who know the operational exceptions. The undocumented monthly export or unusual refund process is often more important than the homepage.

On a controlled copy of the environment, these commands provide a useful starting point:

php -v
php --ini
php -m
composer validate
composer outdated --direct
composer prohibits php 8.4
composer audit
composer check-platform-reqs

Substitute the intended target for 8.4. Run check-platform-reqs under the target runtime because it checks the real PHP version and installed extensions, not just Composer’s configured platform. Do not run an unplanned composer update on production: dependency upgrades can introduce a second set of changes while you are still diagnosing the runtime migration.

Starting position Sensible route What to approve first
Maintained CMS with little custom code Update the CMS and extensions on staging, then test directly on supported PHP 8 Compatibility check and acceptance test
Custom PHP 5 application Inventory dependencies, scan the code, use isolated PHP 7.4 testing if it helps separate failures, then move to PHP 8 Technical audit and phased estimate
Revenue-critical system with weak test coverage Add smoke tests, monitoring and rollback preparation before changing dependencies or runtime Risk-reduction milestone
Small system with obsolete architecture Compare migration cost with replacement and data export Migration-versus-rebuild decision
A migration decision matrix for choosing the route before anyone changes production.

When PHP 7 is a useful bridge

PHP 7 can still be useful as a diagnostic checkpoint for a large custom application. Moving an isolated staging copy from PHP 5.6 to PHP 7.4 can expose one generation of removed functions and changed error behaviour before PHP 8 adds stricter typing and further incompatibilities.

But this is an engineering tactic, not a deployment destination. Keep the PHP 7 environment private, temporary and disconnected from live customer traffic. If a maintained CMS and its plugins already support PHP 8, going directly to the chosen PHP 8 release is usually simpler. An intermediate step should reduce uncertainty; it should not become another legacy platform to maintain.

Use scanners to find work—not to declare success

PHPCompatibility for PHP_CodeSniffer can identify many version-sensitive constructs. If it is installed in the project, a targeted scan might be:

vendor/bin/phpcs -ps . \
  --standard=PHPCompatibility \
  --runtime-set testVersion 7.4-8.4

Set the range to the runtimes you genuinely intend to test. The tool’s own documentation notes that coverage is not complete, so a clean report is not proof that the application works.

Common findings include removed mysql_* calls, obsolete ereg usage, mcrypt-era encryption, incompatible method signatures and code that depends on PHP 5’s loose comparisons or error handling. Treat encryption and authentication changes as design reviews, not search-and-replace jobs. Group changes into reviewable batches: dependencies, removed APIs, fatal runtime errors, behavioural differences and finally warnings or cleanup.

Test business journeys, not just pages

A homepage loading successfully proves very little. Build a compact acceptance checklist around what customers and staff actually do:

  • sign in, reset passwords and manage sessions;
  • submit forms, receive email and process file uploads;
  • search, place orders, pay, refund and generate invoices where applicable;
  • use administration screens and permission-controlled actions;
  • run scheduled jobs, imports, exports, queues and API integrations;
  • confirm redirects, cookies, logging and error reporting.

Use a production-like staging copy with sanitised data, a separate database and detailed logs. Automated tests are valuable, but a short manual walkthrough by the people who operate the system often catches assumptions that are absent from the codebase.

Release it as an operational change

Agree on a deployment window, named decision-maker, verified database and file backups, rollback trigger and post-release monitoring period. Test the rollback procedure before launch; “we have a backup” is not the same as knowing how long restoration takes or which transactions could be lost.

The successful outcome is not merely a higher version number. It is a supportable application with known dependencies, repeatable deployment, tested business journeys and a realistic maintenance path. If you have inherited a PHP 5 system and need help deciding whether to migrate, stabilise or replace it, Greg can provide a focused technical audit and a practical delivery plan.

Related on GrN.dk

  • MariaDB 10.6 EOL: quiet CMS hosting debt needs a real upgrade plan before July 2026
  • Apache 2.4.68 Is a Reminder That Old Proxy Rules Need a Real Audit
  • Why Your Website's Third-Party Stack Needs a Real Owner

Need help with this kind of work?

Discuss your PHP migration with Greg Get in touch with Greg.

Sources

  • PHP: Supported Versions
  • PHP: Unsupported Branches
  • PHP Manual: Migrating from PHP 5.6.x to PHP 7.0.x
  • Composer Command-line Interface
  • PHPCompatibility for PHP_CodeSniffer
Last modified
2026-08-12

Tags

  • php
  • Legacy Systems
  • PHP migration
  • Technical Debt
  • Application modernisation
  • Log in to post comments

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
2026-09-02

WordPress 7.1 helps AI agents discover and invoke site abilities. Here is how to keep exposure, authentication and permission firmly separate.

Illustrated infographic summarizing: From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
2026-09-01

How to use AI for meeting notes and follow-up while fixed rules protect CRM data, customer matching and the sales pipeline from errors and premature changes.

Illustrated infographic summarizing: Your AI Gateway Can Name the User. Decide What That Log Is For
Your AI Gateway Can Name the User. Decide What That Log Is For
2026-08-31

Identity-aware AI Gateway logs can sharpen security and cost control, but only when attribution, access, retention, guardrails, and response are clearly defined.

Illustrated infographic summarizing: Zero Data Retention Is a Workflow Audit, Not a Checkbox
Zero Data Retention Is a Workflow Audit, Not a Checkbox
2026-08-30

Zero Data Retention covers the provider, not every copy in your stack. See how to audit endpoints, logs, storage, deletion and project-level controls.

Illustrated infographic summarizing: MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
2026-08-29

MCP’s July 2026 release removes protocol sessions and tightens OAuth. Here’s a practical plan for migrating clients, servers and enterprise access safely.

Illustrated infographic summarizing: Turn a Technician’s Voice Note into a Work Order—Not Raw Audio
Turn a Technician’s Voice Note into a Work Order—Not Raw Audio
2026-08-28

Voice input can reduce the technician’s documentation burden when hours, materials and status are validated before the information is saved in the work order system.

Illustrated infographic summarizing: ChatGPT Disabled Personal Knowledge Sync. What Broke on Your Team?
ChatGPT Disabled Personal Knowledge Sync. What Broke on Your Team?
2026-08-27

ChatGPT retired personal sync connections for Enterprise and Edu. Here is how to find affected workflows, migrate access, and test permissions.

Illustrated infographic summarizing: Cloudflare’s September Bot Defaults Could Quietly Cut AI Visibility
Cloudflare’s September Bot Defaults Could Quietly Cut AI Visibility
2026-08-26

Cloudflare’s September bot defaults give publishers more control, but one training block could also cut search crawling and AI-driven discovery.

Illustrated infographic summarizing: Does Your AI Chatbot Clearly Identify Itself?
Does Your AI Chatbot Clearly Identify Itself?
2026-08-25

The EU’s transparency requirements for AI chatbots now apply. Here is how to make your bot’s identity clear, limit its system access and provide a genuine route to a member of staff.

Illustrated infographic summarizing: Should publishers add Google’s new Preferred Sources button?
Should publishers add Google’s new Preferred Sources button?
2026-08-24

Google’s Preferred Sources button is worth a controlled test for eligible publishers, with careful choices around placement, performance and measurement.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register