History

The Origins of PHP: From Personal Home Page Tools to Modern PHP 8

PHP began in 1994 as a set of scripts for Rasmus Lerdorf's own home page. This is how it grew into the language that powers WordPress and much of the web.

By Zebra Hosting Cloud

PHP is one of the most criticised programming languages and also one of the most successful. It runs a very large part of the web, including WordPress, and it started in 1994 as a small personal project. Its history shows how a practical tool can win by being easy to use, and how it can later grow up.

A tool for a home page

Rasmus Lerdorf, a Danish-Canadian programmer, wrote the first version in 1994. He wanted to know who was reading the online résumé on his personal website, so he wrote a few programs in the C language, to be run by the web server, that logged visits. He called the collection "Personal Home Page Tools", which is where the letters PHP come from.

In 1995 he released the code publicly and announced it on Usenet, followed by a bigger version called PHP/FI (Personal Home Page / Forms Interpreter), which could process HTML forms and talk to databases. Other webmasters found it useful, because writing the same functions with Perl scripts was more work. The key idea was that you could put small pieces of code directly inside an HTML page, and the server would run them before sending the page to the visitor.

PHP 3: a language for a community

In 1997, two Israeli students, Andi Gutmans and Zeev Suraski, were working on an e-commerce project and found PHP/FI too limiting. They rewrote the parser and, with Lerdorf, released PHP 3 in 1998. The name was changed to a recursive acronym: PHP: Hypertext Preprocessor. PHP 3 had a modular design that allowed extensions, and support for many databases, including MySQL. Its popularity grew rapidly, and the language was installed on many web servers by the end of the 1990s.

The Zend Engine and later versions

Gutmans and Suraski went on to rewrite the core engine, and named it Zend, a combination of their first names. It was the basis of PHP 4, released in 2000. Each version since then added something major:

VersionYearHighlights
PHP 42000Zend Engine, sessions, wider adoption on shared hosting
PHP 52004Proper object-oriented programming; PDO database layer (from 5.1)
PHP 72015Major speed improvements, scalar type declarations
PHP 82020Just-in-time compiler, named arguments, union types, attributes

There was no PHP 6 release. A planned version with full Unicode support was abandoned, and the project skipped the number for PHP 7 to avoid confusion with earlier books and articles about the unreleased version.

Why PHP spread

  • Low barrier. A beginner could add dynamic behaviour to a page in minutes.
  • Cheap hosting. Because PHP fits the Apache and MySQL model, almost every shared host supported it.
  • A huge library of ready-made software. Forums, shops and content systems written in PHP could be installed by people who did not code.
  • A shared-nothing design. Each request starts fresh, which makes the model simple to understand and to scale by adding servers.

The criticism

PHP's growth was organic, and it showed. Function names and argument orders were inconsistent, and early habits such as register_globals, which automatically created variables from request data, led to security problems. A well-known essay from 2012 titled "PHP: a fractal of bad design" summed up many complaints. The community responded: tools such as Composer, the package manager, appeared in 2012, the PHP-FIG group produced shared coding standards, and frameworks like Laravel and Symfony encouraged cleaner code. Modern PHP is a significantly better language than its reputation suggests.

PHP today and the supported-versions rule

The PHP project supports each release for a limited period: usually two years of general fixes, followed by a further period of security fixes only. After that, a version receives nothing, even for serious vulnerabilities. This matters to site owners, because many sites still run on versions that are no longer supported.

  1. Check which PHP version your site uses in your control panel.
  2. Look at the PHP project's supported-versions page to see whether it is still maintained.
  3. Test your plugins and theme on a staging copy with a newer version.
  4. Switch the live site, and keep a backup so you can roll back.

PHP in the hosting world

For hosting providers, PHP changed the economics of dynamic sites. Before it, running a dynamic page often meant CGI scripts, where the server started a new process for each request. Embedding the interpreter in the web server, as the Apache module did, made each request cheaper, and that let a shared server handle many more visitors. Later approaches such as PHP-FPM, a process manager that keeps worker processes ready, improved isolation and speed further, and allowed each customer's site to run under its own user account. These improvements are invisible to site owners, but they are the reason that a modern shared plan can run a busy WordPress site that would have overwhelmed a server twenty years ago.

The lesson for site owners

PHP shows that simple tools last, and that the software under your site needs maintenance. Running an up-to-date version is one of the easiest ways to improve both speed and security. On Zebra Hosting you can select PHP versions per site in Plesk, and our WordPress hosting is set up for PHP-based sites. If you are not sure whether an old site will survive an upgrade, the knowledgebase and our support team can help you plan it.