What PHP Is and Where It Came From
PHP is a server-side scripting language that runs code on the web server and sends only the resulting output, usually HTML, to the browser.
Follow a server-side program from a request to the response a browser receives.
Pageturn is a small online bookshop. Every visitor should see today's prices and whether Dune is in stock, so the page must be built fresh for each request. That is the job PHP was made for.
The rule
PHP runs on the server, builds the page, and sends only the result.
What it is. PHP is a general-purpose scripting language that is best known for building web pages on the server. The name is a recursive acronym: PHP: Hypertext Preprocessor. A PHP file can mix plain HTML with code:
<p>Dune costs <?php echo 9.99; ?> today.</p>The browser asks for the page, the web server hands the file to PHP, PHP runs the code, and the browser receives only <p>Dune costs 9.99 today.</p>. The visitor never sees the PHP source.
Where it came from. In 1994 Rasmus Lerdorf wrote a few small tools to track visits to his personal home page. Others wanted them, and they grew into a language. Key milestones:
- PHP 3 (1998): rewritten by Andi Gutmans and Zeev Suraski; the first version that looks like modern PHP.
- PHP 4 (2000): the Zend Engine arrived underneath.
- PHP 5 (2004): proper classes and objects.
- PHP 7 (2015): roughly twice as fast, plus type declarations for scalar values. (PHP 6 was abandoned, so the numbering skipped it.)
- PHP 8 (2020 onward):
match, named arguments, the nullsafe operator?->, union types and a JIT compiler; later 8.x releases added enums, readonly properties and more.
This course uses PHP 8.x; check the date on older tutorials before copying a pattern.
Running it yourself. Beginners often install a bundle that packages a web server, PHP and a database together: XAMPP (any system), WAMP (Windows), MAMP (macOS) or a LAMP setup on Linux. You only need PHP itself to start, though: php -S localhost:8000 runs a small built-in development server in the current folder.

