Zum Inhalt springen

PHP: The Web's Workhorse

Zusammenfassung

PHP began in 1994 as a set of simple tools that Rasmus Lerdorf wrote to track visitors to his personal homepage — the name originally stood for “Personal Home Page.” It was never designed as a programming language; it grew into one by accident, accreting features as web developers demanded them. Mocked by computer scientists for its inconsistent design, PHP nonetheless became the most widely deployed server-side language on the web, powering WordPress, Wikipedia, Facebook’s early years (see The Social Media Revolution), and a huge share of all websites. It is the definitive case of a “worse is better” technology winning through accessibility and ubiquity.

An Accidental Language

In 1994, Rasmus Lerdorf, a Danish-Canadian programmer, wrote a collection of Common Gateway Interface (CGI) scripts in C to maintain his personal website and track who viewed his online résumé. He called the bundle “Personal Home Page Tools” — PHP. In 1995 he released the source publicly, and as other people adopted it and asked for features, Lerdorf added the ability to embed code directly inside HTML and to talk to databases.

PHP was never the product of language-design theory. It was a practical tool that solved an immediate problem: making web pages dynamic without the ceremony of writing full CGI programs. You could take an HTML file, sprinkle <?php ... ?> tags into it where you needed dynamic content, and the server would execute that code and send back finished HTML. This embedded-in-HTML model was extraordinarily approachable for the web designers and hobbyists who were building the early web.

The major rewrite came in 1997–1998, when two Israeli developers, Andi Gutmans and Zeev Suraski, rebuilt PHP’s core. They retroactively redefined the acronym as the recursive “PHP: Hypertext Preprocessor,” and their new engine, later named the Zend Engine (PHP 4, 2000), turned PHP into a genuine general-purpose scripting language with consistent performance.

Why It Won the Web

PHP’s dominance came from removing friction at every step:

  • Low barrier to entry: you did not need to understand compilation, deployment pipelines, or even programming structure. You could mix logic into a web page and get a working dynamic site immediately.
  • The LAMP stack: PHP was the “P” in LAMP (Linux, Apache, MySQL, PHP) — a completely free, open-source web stack that any hobbyist or small company could run for nothing. In the late 1990s and 2000s, this was the cheapest, fastest way to put a database-backed website online.
  • Ubiquitous cheap hosting: shared web hosts offered PHP by default for a few dollars a month. If you wanted to publish a dynamic site, PHP was almost always already installed and ready.
  • Pragmatic, forgiving design: PHP let beginners get things working without strict discipline, which lowered the learning curve even as it frustrated purists.

The result was sheer ubiquity. At its peak, PHP ran on the large majority of all websites whose server-side language could be identified.

The Software It Built

PHP’s reach is most visible in the dominant applications written in it:

  • WordPress (2003) — the content-management system that powers a very large fraction of all websites in the world.
  • Wikipedia — runs on MediaWiki, written in PHP.
  • Facebook — was built in PHP and scaled on it for years; the company invested heavily in making PHP fast (see below).
  • Drupal, Joomla, Magento (e-commerce), phpBB (forums), and Laravel (the leading modern PHP framework).

The Criticism — and “Worse Is Better”

PHP became a favorite target of programming-language critics. Because it grew organically rather than by design, its standard library was notoriously inconsistent: function names used different conventions (strlen vs. str_replace), argument orders were unpredictable, and the same operation might behave subtly differently in different contexts. A famous 2012 blog post, “PHP: a fractal of bad design,” catalogued these inconsistencies at length. Earlier versions had genuine security pitfalls (such as register_globals) that produced a generation of vulnerable applications.

Yet PHP is the textbook embodiment of Richard Gabriel’s “worse is better” thesis: a technology that is simpler, more accessible, and good enough can defeat more elegant alternatives precisely because it gets adopted and deployed everywhere. PHP did not win because it was well-designed; it won because it let millions of people build working websites with minimal friction.

The Modern Comeback

PHP did not stand still. Facebook, straining against PHP’s performance, built HHVM (the HipHop Virtual Machine, a just-in-time compiler) and its own PHP dialect, Hack, with static typing. The competitive pressure helped drive the open-source PHP project to a major modernization: PHP 7 (2015) roughly doubled performance and slashed memory use, and PHP 8 (2020) added a just-in-time compiler, named arguments, attributes, union types, and other modern features. Combined with the elegant Laravel framework (whose conventions owe much to Ruby on Rails) and the Composer dependency manager, modern PHP is a far more disciplined and capable language than its reputation suggests.

Legacy

PHP is the workhorse that quietly carried much of the web. It proved that accessibility beats elegance for mass adoption: by meeting beginners exactly where they were — embedding code in HTML, running on cheap hosting, demanding no theory — it onboarded a generation of web developers and underpinned the content platforms that defined the web’s first two decades. Decades after Lerdorf’s visitor-counting scripts, the language still serves a major share of the world’s websites, a testament to how durable “good enough and everywhere” can be.

📚 Sources