How to Replace PHP Websites and Systems with AI: When to Replace, 4 Approaches and How to Avoid Failure

Rebuilding a legacy PHP system by recovering its specs with AI

“We were told our PHP version is outdated, but we don’t know whether to rebuild.” “We can’t reach the company that built it, and there are no specs.” We are hearing more and more questions like these about websites and business systems built with PHP. In October 2026, serious vulnerabilities were found in PHP itself (CVE-2026-109618 / CVE-2026-109619), and fixes were released only for PHP 8.2 and later. Continuing to run old PHP is no longer something you can simply “wait and see” on. This article explains, from a developer’s perspective, how to decide whether to replace (rebuild) a PHP system, how the four approaches differ, and what changes when you use generative AI.

Rebuilding a legacy PHP system with AI in 30 seconds (no audio)

Three risks of staying on old PHP

1. Vulnerabilities are found but never fixed

Each PHP version has a fixed support period. Once that period ends, no fixes are provided even when vulnerabilities are found. Here is the support status as of October 2026 (official PHP supported versions).

VersionStatus (as of October 2026)End of security fixes
PHP 8.1 and earlier (including 5.x and 7.x)End of lifeAlready ended. No fixes are provided
PHP 8.2Security fixes onlyDecember 31, 2026
PHP 8.3Security fixes onlyDecember 31, 2027
PHP 8.4Active supportDecember 31, 2028
PHP 8.5Active supportDecember 31, 2029

Security fixes for PHP 8.2 also end in about two months. If your system currently runs on PHP 8.2 or earlier, assume you will need to act soon.

2. One day it stops running on the server

Shared hosting and cloud providers phase out old PHP versions one by one. After the cutoff date, your site may start showing errors even though you changed nothing. Programs (libraries) provided by external services such as payments, loyalty points and shipping may also drop support for anything but newer PHP, causing confusing failures like “the pages load, but only payments fail.”

3. The people who built it are gone, and no one can fix it

The longer a PHP system has been in use, the more likely it is that the people who know its specs have left, through staff turnover or a web agency closing its doors. Without specs, and with code that has grown complex through patch after patch, every small fix breaks something else and quotes for changes keep rising.

Rebuild or keep running: how to decide

Not every old system needs to be rebuilt right away. Check where you stand from three angles: risk, maintainability and cost. The more of the following items apply, the more urgent a replacement is.

  • It runs on PHP 8.1 or earlier (or you don’t know which version)
  • It handles personal information or payments, or people outside the company use it
  • Support has ended for the framework it uses (CakePHP 2, FuelPHP, older Laravel, etc.)
  • There are no specs, or they don’t match how the system actually behaves
  • No one on staff understands how the system works inside
  • Even small fixes sometimes break something else
  • Annual maintenance and modification costs keep rising

On the other hand, for a small internal tool that handles low-sensitivity information and has well-organized code, a PHP version upgrade plus partial fixes may be enough.

Four approaches to replacement

“Rebuilding” can mean one of four broad approaches. Choose based on the state of the system and how long it can be taken offline.

ApproachWhat it involvesBest whenWatch out for
PHP version upgradeKeep the code and fix it so it runs on a newer PHPThe code is fairly clean and the framework is recentOutdated design and vulnerable coding patterns remain. It may not solve the root problem
Partial modificationRewrite only the most problematic partsProblems are concentrated in one areaRepeated rounds can end up costing more than a rebuild
Phased rebuildBuild a new system alongside the old one and switch over screen by screen or feature by featureBusiness systems that can’t be stopped, large websitesSet operating rules for the period when old and new run in parallel
All-at-once rebuildBuild a new system and switch everything over on a single dayThe system is small and can be stopped brieflyProblems pile up on cutover day. A rollback procedure is essential

For systems that can’t be stopped, the third option, a phased rebuild, keeps risk lowest. You run old and new in parallel and route each URL or feature to the new side in turn, so each switchover only requires checking a small scope.

How generative AI changes PHP replacement

The biggest reason replacements have been expensive and slow is the work of figuring out “what the current system actually does” by having people read the code. Generative AI dramatically shortens this step. We use vibe coding, in which engineers write code in dialogue with AI, every day, and built this very website through conversation with AI alone. In a replacement, we use AI in the following four steps.

1. Recover the specs from the code

We have AI read the PHP files and database structure and list “which screen takes what input, which data changes, and which external services it talks to.” Even with tens of thousands of lines of code, you get the full picture quickly, and people can focus on checking whether that list matches the actual business.

Summarize what the following PHP file does.
– Organize it into a table with five parts: “screens,” “inputs received,” “database reads/writes (table and column names),” “external communication,” and “behavior on error”
– Do not guess anything that can’t be determined from the code; write “Unknown (needs checking)” instead
– List any security problems (SQL injection, missing input validation, etc.) separately
—
(Paste the contents of the PHP file here)

The key is the instruction “don’t guess; write Unknown.” AI can produce plausible-sounding explanations (hallucination), so make the unknowns explicit and have a person verify them.

2. Rewrite the same behavior in a new environment

Based on the recovered specs, we rewrite the same behavior in the latest PHP (Laravel, etc.). AI builds routine parts such as screens and data entry and search in minutes. Engineers can spend their time on the parts that need judgment: organizing the design, security and performance.

3. Generate old-vs-new comparison tests automatically

The scariest outcome of a replacement is “it doesn’t behave like before.” We use AI to prepare large numbers of tests that feed the same input to the old and new systems and check that the results match. This covers far more ground than people checking by hand.

4. People review and decide

Code written by AI is always reviewed by an engineer before it is used. Decisions such as how to preserve business rules, how to migrate data and when to switch over are people’s work. We never pass your personal information or confidential data to AI.

How a replacement proceeds (6 steps)

  1. Assess the current system: review the code, database and server environment, recover the specs with AI, and identify high-risk areas
  2. Propose new screens: build the main screens so they run in the new environment, check them, and decide what to keep, change and drop
  3. Migration plan and quote: decide the switchover order, data migration method, schedule and cost
  4. Development and comparison testing: develop while confirming that old and new produce the same results
  5. Data migration and switchover: rehearse in a staging environment, then migrate production data and switch over feature by feature
  6. Operation and maintenance: run the system with a setup that can keep up with PHP and framework updates

In our PHP System Replacement service, we commit to completing steps 1 and 2 and showing you new screens within one week of starting.

Common pitfalls and how to avoid them

Common mistakeWhat happensCountermeasure
Skipping the assessment“It turns out it also did this” keeps coming up mid-development, and time and cost balloonRecover the specs with AI first, list screens, features and data, then quote
Switching everything at onceProblems pile up on cutover day and operations stopSwitch over in phases, feature by feature
Carrying over every current specEven unused features get rebuilt, driving up costCheck actual usage and don’t rebuild unused features
No plan for verifying dataMissing or garbled migrated data is discovered only laterDefine how to reconcile record counts, totals and samples, and verify in a rehearsal
No rollback procedureWhen problems occur, you can’t go back to the old systemBefore switching over, define the criteria and procedure for rolling back

Thinking about cost and timeline

The cost of a replacement depends mainly on the number of screens and features, the volume and complexity of the data, and the number of integrations with external services. An initial assessment is essential for an accurate quote. Generative AI shortens both this assessment and the routine implementation of screens and data processing, making it easier to shorten the timeline for a project of the same size.

If your budget is limited, rather than rebuilding everything at once, you can replace features in order, starting with those with the biggest security problems and those used most often. You confirm the results of the first phase before moving to the next, which also makes investment decisions easier.

We have no specs and can’t reach the company that built it. Can it still be rebuilt?
Yes, as long as you have the source code and the database. We use AI to analyze the code and list the screens, features and data, then finalize the specs while checking with the people who actually use the system. We can also help you obtain the source code (for example, by retrieving it from the server).
Isn’t upgrading the PHP version enough?
If the code is well organized and the framework is recent, an upgrade may be enough. However, outdated coding patterns and vulnerable processing remain as they are, so for systems that handle personal information or payments, it is safer to also consider rewriting the problematic parts.
Is AI-written code a problem for quality or security?
We never use AI-written code as is. Engineers review it, and we verify behavior with automated tests and old-vs-new comparison tests before delivery. AI handles “writing and reading fast”; people handle “design, judgment and verification.”
Can we maintain the system ourselves after the rebuild?
We write code following the conventions of standard frameworks and deliver design documentation and tests, so your in-house staff or another company can maintain it. Making sure the system can keep up with PHP and framework updates is one of the key goals of a replacement.

Summary

Legacy PHP systems carry three risks: vulnerabilities that never get fixed, the system stopping on the server, and no one being able to fix it. A replacement starts with assessing the current system, and for systems that can’t be stopped, phased switchover is the standard approach. Generative AI greatly shortens spec recovery, rewriting and comparison-test preparation, making it possible to rebuild even systems without specs. ReedRiver takes on PHP system replacement using AI vibe coding as contract development. We show you new screens within one week of starting, so begin by asking us for an assessment of your current system.