PHP
| File:Php-logo.svg PHP logo | |
| Paradigm | Multi-paradigm: imperative, functional, object-oriented, procedural, reflective |
|---|---|
| Designed by | Rasmus Lerdorf |
| Developer | The PHP Group |
| First appeared | 1995 |
| Stable release | 8.4
/ November 2024 |
| Typing discipline | Dynamic, weak, gradual |
| Implementation language | C |
| Platform | Cross-platform |
| OS | Cross-platform |
| License | PHP License (BSD-style) |
| Filename extensions | .php, .phtml, .php3, .php4, .php5, .php7, .phps |
| Website | www |
| Major implementations | |
| Zend Engine, HHVM, Phalanger | |
| Influenced by | |
| C, Perl, Java, C++, Tcl | |
| Influenced | |
| Hack | |
Search PHP on Amazon.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a general-purpose, server-side scripting language designed mainly for building dynamic web pages.[1] It was created by Rasmus Lerdorf in 1994 and released publicly in 1995.[2] PHP code is usually executed on a web server by the PHP interpreter, and its output — commonly HTML — is sent to the browser.
Also known as: PHP Hypertext Preprocessor, Personal Home Page Tools, Personal Home Page / Forms Interpreter (PHP/FI).
What is PHP?
PHP is a widely-used, open-source, general-purpose scripting language that is especially suited to web development and can be embedded directly into HTML.[1] Rather than running in the browser like JavaScript, PHP runs on the server: the browser requests a page, the server runs the PHP script, and the finished HTML is returned. This makes PHP a server-side language.
PHP is platform-independent — it runs on Linux, Windows, macOS and most Unix-like systems — and is typically deployed alongside a web server such as Apache or Nginx and a database such as MySQL or MariaDB. That combination is often called a LAMP stack (Linux, Apache, MySQL, PHP).[3]
What PHP means
PHP originally stood for Personal Home Page Tools, the name Rasmus Lerdorf gave his set of CGI scripts in 1994.[2] The language was later renamed PHP/FI (Personal Home Page / Forms Interpreter) and then, with PHP 3 in 1998, given its current recursive meaning: PHP: Hypertext Preprocessor.[2]
Who made it
PHP was created by Rasmus Lerdorf, a Danish-Canadian programmer, in 1994.[2] The language is now maintained by The PHP Group and developed by a worldwide community of contributors, with the source code hosted publicly and released under the PHP License, a BSD-style licence.
When it started
- 1994 — Rasmus Lerdorf writes a set of CGI scripts to track visits to his online résumé; he calls them "Personal Home Page Tools".[2]
- 1995 — PHP/FI 1.0 is released publicly; PHP/FI 2.0 follows with form handling and database support.
- 1998 — PHP 3.0 is released, rewritten from scratch by Andi Gutmans and Zeev Suraski, and the recursive name "PHP: Hypertext Preprocessor" is adopted.[2]
- 2000 — PHP 4.0 introduces the Zend Engine, sessions and better object support.
- 2004 — PHP 5.0 adds a much stronger object model.
- 2015 — PHP 7.0 brings large performance gains and modern type hints.
- 2020 — PHP 8.0 introduces a JIT compiler, union types, named arguments and the
matchexpression.[4] - 2024 — PHP 8.4 is released.
What PHP is used for
- Web pages — generating HTML, handling forms and managing sessions.
- Web applications — content management systems, forums, shops and dashboards.
- APIs — returning JSON or XML from REST endpoints.
- Command-line scripts — cron jobs, batch processing and small utilities.
- Templates — server-side templating inside HTML files.
PHP is the server-side language behind a large share of the web's sites, including WordPress, Drupal, Joomla, MediaWiki, Magento, Laravel applications and Wikipedia itself.[5]
How it works
- Write the script — a file ending in
.phpcontaining PHP blocks, usually opened with<?phpand closed with?>, mixed with HTML. - Send a request — a browser (or API client) asks the web server for the page or endpoint.
- The server runs PHP — the web server hands the file to the PHP interpreter, which executes the code.
- The output goes back — whatever the script prints, typically HTML, is sent to the browser as the response.
A minimal example:
<?php
echo "Hello, world!";
?>
Features
- Embeddable — PHP can sit directly inside HTML.
- Open source — free to use, modify and redistribute under the PHP License.
- Cross-platform — runs on most operating systems and web servers.
- Broad database support — built-in extensions for MySQL, PostgreSQL, SQLite, Oracle and more.
- Huge standard library — hundreds of built-in functions for strings, files, dates, arrays, HTTP and beyond.
- Large ecosystem — Composer for package management, plus frameworks such as Laravel, Symfony and CodeIgniter.
- Wide hosting support — the overwhelming majority of shared web hosts run PHP out of the box.[5]
Advantages and disadvantages
Advantages:
- Very low barrier to entry, and near-universal on cheap hosting.
- Massive ecosystem, documentation and community.
- Fast enough for most web workloads, and much faster since PHP 7.
- Native templating makes it easy to mix markup and logic.
Disadvantages:
- Historically inconsistent function naming and argument order in the standard library.
- Weaker type safety than statically typed languages, though modern versions have improved this considerably.
- A large body of older code predates current security and style practices.
History
- 1994 — Rasmus Lerdorf writes the first PHP scripts.
- 1995 — PHP/FI 1.0 released publicly.
- 1997 — PHP/FI 2.0 released.
- 1998 — PHP 3.0 released; renamed PHP: Hypertext Preprocessor.[2]
- 2000 — PHP 4.0 released with the Zend Engine.
- 2004 — PHP 5.0 released with a new object model.
- 2015 — PHP 7.0 released with major performance improvements.
- 2020 — PHP 8.0 released with JIT and new syntax features.[4]
- 2024 — PHP 8.4 released.
See also
References
- ↑ 1.0 1.1 "What is PHP?". PHP Manual. The PHP Group. Retrieved 13 November 2026.
- ↑ 2.0 2.1 2.2 2.3 2.4 2.5 2.6 "History of PHP". PHP Manual. The PHP Group. Retrieved 13 November 2026.
- ↑ "LAMP (software bundle)". Retrieved 13 November 2026.
- ↑ 4.0 4.1 "PHP 8.0 release notes". The PHP Group. Retrieved 13 November 2026.
- ↑ 5.0 5.1 "Usage statistics and market share of PHP". W3Techs. Retrieved 13 November 2026.
