There is a specific phone call we get several times a year. A business owner says the site is down, or their hosting provider has flagged something, or a customer reported a redirect to a gambling site. Every single time, the diagnosis begins in the same place.

PHP.

This is not a language-war article. PHP 8 is a fast, capable language and some of the most reliable systems in production run it. The problem is not the language. The problem is everything that accumulates around it, and the sheer statistical weight of how much of the internet is exposed because of it.

Why PHP Became So Abundant

Understanding the abundance is necessary to understanding the risk.

PHP was built for the web at a moment when nothing else really was. You drop a file on a server, the server runs it, it outputs HTML. No build step, no framework, no deployment pipeline. For a generation of agencies and freelancers, that was a revelation, and it made building a website a thing one person could do in an afternoon.

Hosting companies responded by making PHP the default, because it was cheap to run and every customer wanted it.

The result is that PHP is not merely popular. It is the substrate of small-business web hosting. Roughly three quarters of all websites whose server language can be identified run PHP. That number is not a measure of quality. It is a measure of inertia.

What the abundance means Consequence
Default on nearly all shared hosting Non-technical users deploy PHP by accident
Enormous plugin and theme ecosystem Quality varies wildly, code is rarely reviewed
Huge pool of cheap freelance work Low barriers to entry, inconsistent standards
Massive legacy install base Unpatched systems remain online for years
Almost every tutorial targets it Copy-paste culture, half-understood patterns

The Actual Security Failure Mode

Here is the uncomfortable truth: the vulnerability is rarely exotic. It is nearly always the same handful of mistakes, repeated millions of times.

Unsanitised input. A value arrives from a form and goes straight into a database query. This is SQL injection, and it has been solved for fifteen years. Parameterised queries exist in every PHP database library. It still happens because tutorials written before that solution are still the top search results.

File upload without validation. The upload folder accepts any file type. Someone uploads a script with a friendly extension. It executes.

Outdated dependencies. A site built in 2019 uses a plugin that was abandoned in 2021. The vulnerability was disclosed in 2022. Nobody is watching, so nobody patches.

Exposed admin surfaces. Login panels and database tools left reachable from the public internet, often on a non-standard port the owner believes is a secret.

Secrets in the repository. Database credentials committed to a public repository, because the deploy process was “upload the files.”

None of these are PHP’s fault in a language-design sense. But every one of them is far more common in PHP than in any other ecosystem, because PHP’s ecosystem rewards speed of assembly over durability.

Why This Is Structural, Not Personal

A competent PHP developer with discipline can build a secure system. I have seen it done. But the ecosystem does not encourage it.

Consider the incentives. A plugin marketplace rewards volume and features, not security review. A client shopping on price will pick the cheapest quote every time, and the cheapest quote is only profitable if the work is assembly rather than engineering. Add updates: a PHP site needs its core, plugins, themes, and runtime patched indefinitely. Most businesses do not know this, were never told, and have no process for it.

So the site sits there. Working. Accumulating exposure.

A Table Worth Being Uncomfortable About

Attack pattern Root cause Typical PHP ecosystem cause
Automatic bot compromise Unpatched known CVE Outdated plugin or core
Search-ranking spam injection Arbitrary file write Vulnerable upload or editor
Credential theft Plain or weak hashing Legacy code, old tutorials
Malware redirect Injected obfuscated payload Compromised theme file
Ransomware on hosting account Stolen panel credentials Shared hosting, no 2FA
Defacement Weak admin password Default admin username

Every row has a non-PHP equivalent. Every row is dramatically more frequent in PHP installs. That is the asymmetry that matters.

So Should You Never Use PHP?

That is too blunt, and I would not build a case on absolutes.

There are two legitimate reasons to keep PHP. First, a large existing system where migration cost exceeds the risk, though the risk must then actually be managed with patching, monitoring, and hardening. Second, a very specific need for cheap shared hosting, where expectations are correspondingly low.

What I would argue against is choosing PHP for a new build that matters. Not because the language cannot do it, but because you inherit an ecosystem where the safe path takes more discipline than the fast path, and most suppliers choose fast.

If a site is generating revenue, handling customer data, or representing a brand, the economics of a modern static or edge-rendered stack are now simply better. A build with no database on the request path, no server-side runtime to patch, and no plugin surface to exploit has a fundamentally smaller attack surface. Not smaller because it is cleverer. Smaller because there is less of it.

What We Do Instead

For marketing and brand sites, we build static, served from an edge network. There is no PHP process, no database exposed to the internet, no admin panel reachable at three in the morning. Content is edited through a clean interface and published as static files.

That architecture does not make a site invulnerable. It removes an entire category of failure, which is a different and more honest claim.

If you are currently running a PHP site you are unsure about, the useful first step is not a rebuild. It is an audit that tells you what is actually installed, what is out of date, and what is reachable. We will tell you honestly whether patching is enough or whether the foundation is the problem.