PHP (the recursive acronym for PHP: Hypertext Preprocessor) is a general-purpose scripting language built for the web. Rasmus Lerdorf released the first version as a set of CGI scripts in 1995; PHP 3 in 1998, rewritten by Andi Gutmans and Zeev Suraski, turned it into a full language, and PHP 8.0 in November 2020 added a JIT compiler, union types, attributes and the match expression. Code is written in plain files and executed by the interpreter on each request, so a page is a program that runs on the server and returns HTML — no separate build step, no framework required. PHP is free and open source under the PHP License, and it is the language behind WordPress, Drupal, Joomla, MediaWiki, Nextcloud and Matomo, which is why a working PHP install is almost always one package-manager command away.
declare(strict_types=1), scalar and return type hints, union and intersection types, backed enums, readonly properties and constructor promotion.php -S localhost:8000 serves a project with no Apache or Nginx to configure.PHP is the pragmatic choice for server-rendered web software. Deployment is unglamorous and cheap: nearly every shared host and every Linux distribution ships it, request handling is a well-understood PHP-FPM pool, and the language has two decades of documentation, answers and libraries behind every common problem. The modern language is not the one its reputation was built on — enums, readonly classes, first-class callable syntax and a real type system arrived in 8.x, and the frameworks moved with them. Laravel and Symfony are mature, hiring is easy, and the ecosystem includes the most widely deployed publishing software in the world. When the job is a website, an admin panel, an internal tool or an API in front of a relational database, PHP gets there with fewer moving parts than most alternatives.
Install the interpreter from your distribution (php-cli and php-fpm on Debian and Ubuntu, php on Fedora, brew install php on macOS, or the official Windows builds from windows.php.net), then check it with php -v. Write a file and run it with php script.php, or serve a directory during development with php -S localhost:8000. Add Composer for dependencies and PSR-4 autoloading, and follow the official manual at php.net for the language reference and function index. The current stable series is 8.5, with 8.4 and 8.3 still receiving security fixes; 8.6 is in release-candidate testing. PHP License 4 — the Modified BSD (BSD-3-Clause) licence — covers current releases, while 8.5 and earlier carry the OSI-approved PHP License 3.01.