PHP upgrades

PHP migration and upgrade services without a risky rewrite

Your host is retiring the PHP version your application needs, or the server itself is at the end of its life. We upgrade the code you have, step by step, with tests proving it still behaves the same.

  • Legacy PHP to PHP 8
  • Rehearsed on a full copy
  • Fallback kept until sign-off
What is included
  • PHP version upgrades
  • Deprecated extensions replaced
  • Framework moves
  • Hosting and server relocation
  • Database engine and charset changes
  • Automated refactoring and tests
Get a free quote Reply within one business day. NDA on request.
The problem

What forces a PHP migration

The email from your hosting company gives a date. After it, the PHP version your application runs on will be switched off, or you can pay extra every month to keep it a little longer. Someone tried flipping the version in the control panel and got a white page. The developer who wrote the system left years ago.

This is routine work for us. Old PHP applications fail on new versions for a known list of reasons: removed functions, stricter type handling, retired extensions, outdated libraries. Each has a known fix. The skill lies in finding every instance, changing it without altering behavior, and proving that with tests before your users find out the hard way. The same method covers moving servers, changing database engines and shifting onto a framework. If your application already sits on a framework, our Laravel migration and CodeIgniter 3 to 4 upgrade pages are more specific.

  • The host is ending support for your PHP version

    You have a deadline, a warning banner in the control panel and an application that shows a blank page on anything newer. Paying for extended support only postpones the problem.

  • A white screen after switching versions

    Someone tried the upgrade on the live site. Fatal errors about undefined functions appeared, the switch was reversed, and now nobody wants to try again.

  • Libraries stuck years behind

    The payment, PDF or mail library bundled in the project no longer receives fixes, and its current release requires a PHP version the rest of the code cannot run on.

  • Security scans keep failing

    A client, insurer or payment provider runs a scan and flags an unsupported PHP version and outdated components. Passing it has become a condition of doing business.

What we do

Six kinds of move we handle

Upgrades rarely come alone. A PHP version change usually drags a library update, a database change or a server move with it, so we plan them as one program of work.

PHP version upgrades

Applications on PHP 5 or 7 brought to a current PHP 8 release in stages, fixing removed functions, changed defaults and stricter typing at each step.

Deprecated extensions replaced

Calls to the old mysql_* functions rewritten to PDO with prepared statements, mcrypt swapped for OpenSSL or Sodium, and ereg patterns converted to preg.

Framework moves

Plain PHP or an abandoned framework moved onto Laravel or CodeIgniter one route at a time, with old and new code serving the same site during the transition.

Hosting and server relocation

Shared hosting to a VPS or cloud, or one provider to another. Web server rules, cron jobs, mail sending, file permissions and SSL are recreated and tested before DNS changes.

Database engine and charset changes

MySQL version upgrades, MyISAM tables converted to InnoDB, character sets moved to utf8mb4 and strict SQL mode problems fixed, with row counts and checksums compared.

Automated refactoring and tests

Rector applies mechanical code changes across the whole codebase in reviewable commits, while characterization tests record current behavior and flag any difference after each change.

Typical projects

Typical upgrade projects

01

Legacy application to PHP 8

A business system written for PHP 5 with no tests and no Composer, audited, wrapped in tests, upgraded in stages and redeployed on a supported version.

02

Removing mysql_* from a custom site

Hundreds of string-built queries converted to PDO prepared statements behind a small database class, closing SQL injection holes as a side effect of the upgrade.

03

Move to a new server

Files, databases, cron jobs and mail settings rebuilt on the new host, traffic switched during a quiet hour after a final data sync, and the old server kept ready as a fallback.

04

Gradual move onto a framework

A front controller routes finished pages to the new framework code and everything else to the legacy scripts, until the last old file can be deleted.

In depth

How we upgrade without changing behavior

Find out what will break before changing anything

We start with a copy of production, code and data, running in containers on both the current PHP version and the target. Static scanners such as PHPCompatibility and PHPStan list every use of a removed function, a changed signature or a retired extension. Then we turn error reporting all the way up on the old version and read the deprecation notices the application has been hiding for years. The output is an inventory with counts, which turns "how long will it take" from a guess into an estimate.

Tests first, because there usually are none

Most legacy PHP has no automated tests, and you cannot safely change what you cannot check. So before the upgrade we write characterization tests: scripts that sign in, request the important pages, submit the important forms and store the responses and database changes as the expected result. Their job is to detect change, with no opinion on whether the old behavior was good. The same suite then runs against the upgraded code, and every difference is either a bug we introduced or a deliberate fix we can explain.

Let tools do the mechanical work

Rector rewrites code by rule: removed functions with direct replacements, old-style constructors, curly-brace string offsets, implicitly nullable parameters. We apply one rule set per commit so each change can be reviewed and reverted on its own. What tools cannot decide is left to engineers, and the largest item there is usually database access. The mysql_* functions no longer exist in the language. A search-and-replace to mysqli keeps the old injection risks, so we route queries through PDO with bound parameters, working table by table.

PHP 8 changes that bite quietly

Fatal errors are the easy part because they announce themselves. Behavior changes are harder. Comparing a number with a non-numeric string gives a different answer in PHP 8. Built-in functions that used to return null with a warning for bad input now throw. Arithmetic on a non-numeric string stops the script. Code that relied on the old leniency, often in validation and pricing logic, keeps running and produces different results. This is exactly what characterization tests exist to catch.

Cutover and fallback

We upgrade in hops instead of one leap, deploying each stable step where hosting allows. The final switch is rehearsed on staging with a fresh data copy and scheduled for your quietest hour. The old environment stays intact until you sign off. From then on, staying current costs far less than catching up, which is where a PHP maintenance plan comes in.

Process

Order of work in an upgrade

  1. 1

    Compatibility audit

    We copy the application, scan it against the target PHP version and deliver a report listing what breaks, what is risky and what the upgrade involves.

  2. 2

    Tests around current behavior

    Characterization tests are written for the paths your business depends on, and the project is placed under Git and Composer if it is not already.

  3. 3

    Staged code changes

    Automated refactoring runs first, manual fixes follow, and libraries are updated. The test suite runs after every step, on every PHP version in the path.

  4. 4

    Full run on staging

    The upgraded application runs on the target environment with a recent data copy while your team works through their daily tasks on it.

  5. 5

    Cutover and watch

    We switch at a quiet hour, monitor error logs closely for the following days and keep the previous environment available until you confirm.

Deliverables

What the upgrade leaves behind

  • An application running on a supported PHP version
  • A test suite that did not exist before
  • Every query bound through PDO
  • Dependencies managed and updatable through Composer
  • A written record of what changed and why
FAQ

Upgrade questions owners ask

Can you upgrade straight from PHP 5 to PHP 8?
The destination can be PHP 8, but the work goes through intermediate versions. Each hop surfaces a manageable set of deprecations and errors, and the tests confirm behavior before the next one. Jumping in a single step buries the cause of each failure under all the others.
Should we upgrade or rewrite?
Upgrade when the application does its job and the problem is its age. Rewrites take longer than expected and lose years of quiet bug fixes. Rewrite, or modernize in slices, when the structure itself blocks every change. Our legacy PHP modernization page describes that middle route.
Will our users notice the upgrade?
They should notice very little, apart from pages often loading faster on a newer PHP version. Screens, URLs and data stay the same. The switch itself is done at a quiet hour, and for most applications the interruption is brief.
We have no tests and no documentation. Is that a problem?
It is normal, and we plan for it. We write tests around the critical paths before touching the code and document the system as we learn it. You finish the project with both, which makes every later change less costly.
What about third-party code like payment or PDF libraries?
Bundled libraries are replaced with current Composer packages where they exist. If a library has been abandoned, we swap it for a maintained equivalent and adapt the calling code. Payment integrations are retested end to end in the sandbox of the gateway before going live.
How do you estimate a PHP upgrade?
From the audit, not from a guess. Cost depends on the size of the codebase, the gap between versions, how much database code must be rewritten, the number of outdated libraries and whether a server move is included. The audit report comes with a fixed scope and milestones.
Can you move us to a new server at the same time?
Yes, and it is often the cleanest way. We build the new server on the target PHP version, deploy the upgraded code there, sync data and switch DNS, leaving the old server untouched as a fallback until you are satisfied.
Start a project

Facing a PHP end-of-life deadline?

Send us the PHP version you are on, the one you need to reach and the date your host has given. We reply within one business day and can begin with a compatibility audit.

  • Free consultation and quote
  • NDA on request
  • You own the source code
  • Reply within one business day
Add budget and timeline optional, helps us quote faster

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.