Is PHP Really Finished After PHP2Shell? — The Legacy Architecture Problem Matters More Than the Vulnerability

·Platform Decision·13 min read

한국어로 읽기 →

In October 2026, a serious security problem hit the PHP ecosystem.

Its name: PHP2Shell.

Two vulnerabilities were disclosed, both rated 9.2 under CVSS 4.0. They let an attacker run code remotely without logging in.

The more striking part is that this wasn't a bug found in WordPress or some particular PHP application.

It's a vulnerability in the PHP runtime itself.

Which means that no matter how safely your PHP application is written, if it runs on a vulnerable runtime, it can be affected.

The incident also revived the recurring debate about PHP's future in developer communities abroad.

Arguments run the full range — from "it's time to stop using this old language" to "PHP is still plenty competitive for web development."

But I want to look at this debate from a slightly different angle.

Should you abandon a programming language just because a vulnerability was found in it?

And there's a more important question.

In an era where AI writes the code, is there still a reason to choose PHP?

1. What exactly went wrong with PHP2Shell?

On October 21, 2026, security patches for two serious PHP vulnerabilities were released.

  • CVE-2026-109618: memory corruption during out-of-memory (OOM) handling
  • CVE-2026-109619: memory corruption from invalid internal state left over after a request

Both can lead to remote code execution (RCE) under certain conditions.

The first triggers when memory allocation fails.

When a program can't secure memory, it has to handle the error — and a flaw was found where PHP internally mishandles data that hasn't finished initializing.

The second is a case where internal state pointing to already-freed memory lingers and can be reused.

Vulnerabilities like these aren't fully solved by an application developer doing ordinary input validation well.

Because the problem happens inside the PHP runtime.

In particular, on some attack paths the vulnerability can be exploited before the application code even runs.

Security researchers and the PHP team advised caution across the various execution environments that handle web requests — PHP-FPM, Apache mod_php, php-cgi, and others.

Affected versions and patches

The main fixed releases published on October 21, 2026, are as follows.

PHP version line Fixed version
PHP 8.2 8.2.35
PHP 8.3 8.3.36
PHP 8.4 8.4.27
PHP 8.5 8.5.12

End-of-life versions at PHP 8.1 and below need their risk reviewed too. Some distributors ship their own backported patches, so check not just the version string but your package vendor's security advisory as well.

In production, first confirm the PHP version you're running and the runtime that actually handles web requests.

php -v

Note that the version you see from the CLI isn't necessarily the same as your web server's PHP-FPM or mod_php version.

So it's worth checking the web server config, the PHP-FPM processes, and the container images together.

The real response to this vulnerability is to replace the affected PHP runtime with a build that has the security patch applied.

Don't treat temporary mitigation through a WAF or specific PHP settings as a substitute for patching.

2. Does this mean PHP is a dangerous language?

This vulnerability is serious.

Even so, it's hard to conclude that PHP as a whole is a dangerous language just because a vulnerability was found in it.

Serious vulnerabilities have been found in other languages and runtimes too — C/C++, Java, Python, Node.js.

There's a distinction worth making here.

A language's own characteristics, a vulnerability in the runtime implementation, and an application design problem are three different domains.

Say a PHP application has a SQL injection flaw.

That's generally a problem with an application that didn't handle database queries safely.

PHP2Shell, by contrast, is a problem related to memory handling inside PHP.

The two have different causes and different fixes.

PHP has also kept adding modern language features.

Type declarations, enums, attributes, JIT, OPcache — a lot has changed compared to old PHP.

So it isn't fair to judge PHP only by what it looked like in the early 2000s.

But what this incident showed is clear.

Even when application code is safe, if the runtime beneath it is vulnerable, the whole service can be affected.

This isn't a PHP-only issue — it's a software supply chain and runtime security issue.

3. Why PHP has survived this long

PHP was once used as the de facto standard for web development.

The LAMP stack — Linux, Apache, MySQL, PHP — was the go-to way to build a web service.

User
   │
   ▼
Apache / Nginx
   │
   ▼
PHP Application
   │
   ▼
MySQL / MariaDB

Back then PHP's edge was obvious.

Install PHP on a web server, connect a database, and you could build a dynamic website relatively fast.

WordPress, phpBB, Drupal, Magento — a range of applications grew the PHP ecosystem.

But over time the web development landscape changed a lot.

Containers arrived, cloud became the norm, and microservices and serverless architectures spread.

That doesn't mean PHP can't support these environments.

PHP applications can be deployed in containers and run on Kubernetes. You can build API services with a framework like Laravel.

The problem lies elsewhere.

Being able to implement something technically and it being economically sensible to choose it are two different things.

4. In the cloud era, operating cost matters more than development cost

In the past, what mattered was how fast and cheap you could build a web service.

PHP had a strength there.

But in cloud environments, the cost after you've built it matters too.

Because the CPU, memory, network, and storage costs that accrue while running a service keep piling up.

Say you build the same API service in PHP and in Go.

Even assuming both can handle 1,000 requests per second, there's no guarantee they need the same server resources.

The actual cost depends on factors like these.

  • CPU usage per request
  • Memory usage of processes and workers
  • Number of database accesses
  • How caching is used
  • The concurrency model for handling requests
  • Deployment and scaling approach

Go and Rust can have an advantage in CPU and memory efficiency for certain kinds of workloads.

PHP, on the other hand, can deliver perfectly good performance through OPcache, PHP-FPM tuning, and sound cache design.

So you can't declare that PHP has high operating costs simply because it's interpreter-based.

In real web services especially, the bottleneck is often database queries or external API calls rather than language execution speed.

What matters isn't a simple per-language benchmark.

It's comparing the total operating cost needed to satisfy the same service requirements.

That has to include development staff, incident response, maintenance, and migration costs.

5. What I pay more attention to is the legacy architecture

In the PHP debate, what personally interests me more than the language itself is the old system structure.

Fifteen years of development, system design, and operations work taught me something.

A legacy system's biggest problem isn't that it uses old technology. It's that it has hardened into a structure that's hard to change.

Say you find a structure like this in an old PHP application.

Web Request
     │
     ▼
PHP Application
     │
     ├── User authentication
     ├── Business logic
     ├── Database handling
     ├── File upload
     ├── External API calls
     └── Batch jobs

Many functions are tightly coupled inside one application.

Change a small feature and it can affect the entire system.

The thing is, this isn't a PHP-only trait.

You can find the same problem in an old monolithic application written in Java.

Build it in Python or Node.js and if the architecture is poorly designed, the same problem shows up.

Conversely, even if it's written in PHP, with clear responsibilities between modules and a solid test and deployment setup, it can be a system that's pleasant to maintain.

So the first thing to do about a legacy problem isn't to swap the language.

It's to figure out what, in the current system, makes change hard.

This is also why migration and refactoring need to be kept separate.

6. In the AI era, PHP's competitiveness can shift

There's one interesting change here.

AI coding agents.

In the past, when adopting a new language, securing developers and the learning cost were fairly important variables.

For a PHP team to switch to Go or Rust, they had to learn a new language, evaluate frameworks, and reimplement existing code.

That took a lot of time and money.

But with AI in the picture, some of those costs have started to drop.

Developers design the requirements and the architecture, while AI can assist with writing code, generating tests, and refactoring.

Say you want to split a particular API out of an existing PHP service into Go.

In the past a developer had to analyze the existing code and reimplement it in the new language themselves.

Now you can have the AI analyze how the existing API behaves, generate test cases, and then write the new implementation.

Of course, there's no guarantee the AI-generated code behaves identically to the existing system.

Transactions, exception handling, data consistency, authentication, performance — those need to be verified separately.

Even so, the important shift is clear.

The code-writing cost of changing programming languages is more likely to be lower than it was.

This change affects not only PHP but every language — Java, Python, Node.js.

Where a team's existing proficiency used to be a major reason for a technology choice, operational efficiency and architectural fit may carry more weight going forward.

But this doesn't amount to the end of PHP.

AI can write good PHP too.

If anything, it may help you maintain existing PHP systems more easily.

7. So should you rewrite your PHP service in Go or Rust?

I'm against rewriting an existing PHP service in another language unconditionally.

Because migration always comes with cost and risk.

Say you have a WordPress-based site running fine.

Traffic isn't heavy, operating costs are plenty low.

Security patching and backups are well in place.

Is there a reason to go rebuild this service in Go or Rust?

If anything, the rebuild could increase cost and the risk of outages.

On the other hand, if you have an API server handling large traffic and a specific PHP feature keeps driving up CPU usage and memory cost, the story changes.

In that case you can analyze the bottleneck and consider a strategy of splitting some functions out into another language.

For example, a structure like this.

               Client
                 │
                 ▼
             API Gateway
                 │
        ┌────────┴────────┐
        │                 │
        ▼                 ▼
   PHP Application    Go / Rust Service
        │                 │
        ▼                 ▼
   Existing business   High-performance
       logic              workloads

You keep the existing PHP application while splitting off the parts with performance or scalability problems first.

This connects to the incremental migration strategy used in moving to microservices.

Of course, splitting services introduces new complexity — network calls, data consistency, failure handling.

So splitting into microservices isn't automatically the right answer.

In the end the criterion is clear.

You don't migrate in order to change languages. You migrate when there's a problem that needs solving.

8. What operators should do after PHP2Shell

In the wake of this, if your organization uses PHP, there's something to do before the technology-replacement debate.

Get an accurate picture of your current operating environment.

Because PHP isn't only used in applications you built yourself.

A CMS like WordPress, of course — but PHP can also sit inside some admin tools or commercial products.

So just checking whether PHP is installed on the server isn't enough.

You have to confirm which processes actually handle external requests.

In container environments, you also need to inspect the PHP runtime bundled inside the image.

In a Kubernetes environment, you can list the running workloads like this.

kubectl get pods -A

But this command alone won't tell you whether PHP is in use.

You need to additionally check the image list and deployment config.

kubectl get pods -A \
  -o custom-columns='NAMESPACE:.metadata.namespace,POD:.metadata.name,IMAGES:.spec.containers[*].image'

PHP sometimes doesn't appear in the image name, so it's worth checking the image SBOM, the package list, and the actual runtime.

There are roughly four things an operator should check.

First, confirm whether an affected PHP runtime exists.

Second, update to a patched version or the vendor's fixed build.

Third, inspect the container images and deployment environment that include PHP.

Fourth, review web server logs and security events, considering that attack attempts may have happened even before the vulnerability was disclosed.

In particular, attack attempts before public disclosure were reported for this vulnerability.

So don't assume all your security review is done just because you finished patching.

If needed, investigate for compromise and assess the possible exposure of related credentials and sensitive data.

9. A question that matters more than PHP's future

PHP2Shell has prompted some to argue that PHP is finished.

But I don't see it that simply.

A programming language doesn't disappear over a single security vulnerability.

Because the existing systems and ecosystem, the developer community, operating cost, and migration cost all play a part.

PHP is still used in countless web services.

A huge ecosystem like WordPress exists too.

The odds of all these systems migrating to another language in a short span are low.

That said, designing a new system calls for a slightly different judgment.

There's no need to pick the same technology just because you're used to it.

And conversely, no need to drop existing technology just because a new language appeared.

In technology selection, I weigh three things.

First, can it best solve the current requirements?

Second, have you also accounted for the operating and maintenance cost after development?

Judged on development speed alone, the familiar technology wins. But in cloud environments, the resource cost that accrues while a service runs, plus incident response and maintenance, weighs more heavily.

Third, is it a structure you can change as things change?

More than what language it was written in, whether you can swap or split out parts when you need to is what decides a system's lifespan. It's worth recalling again that the real problem with legacy isn't old technology but a structure that's hard to change.

Held up against these three questions, PHP2Shell is less a reason to abandon PHP and more an occasion to re-examine your own system. A runtime can be patched. But a structure that's hard to change isn't solved by a patch.

In an era where AI writes the code for you, the cost of changing languages drops. So paradoxically, the question of what you need to solve matters more than what you wrote it in.

Was this post helpful?

One click helps me write the next one

#PHP#Security Vulnerability#Legacy#Migration#Tech Selection#RCE#Architecture