PHP
Adapted from Wikipedia · Adventurer experience
PHP is a general-purpose scripting language for web development. It was created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. At first, PHP stood for Personal Home Page. Now, it means PHP: Hypertext Preprocessor, a recursive backronym.
PHP code runs on a web server. The server uses a special program to change the code into a web page. This lets PHP create parts of websites on the fly, like showing today's date or getting data from a database.
Because PHP is free software and works on many kinds of computers, it is very popular for building websites. Many tools help developers use PHP to create simple pages or big online services.
History
The PHP language began in 1993 when Rasmus Lerdorf created tools to manage his personal homepage using Common Gateway Interface programs. He made these tools work with HTML forms and databases, calling them "Personal Home Page/Forms Interpreter" or PHP/FI.
PHP/FI could build simple and dynamic web applications. It was first shared publicly in 1995 and grew quickly. Over time, more people helped to develop PHP.
In 1997, Zeev Suraski and Andi Gutmans redesigned PHP, which led to PHP 3. They kept improving it, creating PHP 4 in 2000 and PHP 5 in 2004. Each new version added important features and made PHP more powerful.
Later versions, like PHP 7 and PHP 8, focused on making the language faster and easier to use. These updates helped PHP stay popular for building websites and web applications.
| Version | Release date | Supported until | |
|---|---|---|---|
| Unsupported: 1.0 | 8 June 1995 | ||
| Unsupported: 2.0 | 1 November 1997 | ||
| Unsupported: 3.0 | 6 June 1998 | 20 October 2000 | |
| Unsupported: 4.0 | 22 May 2000 | 23 June 2001 | |
| Unsupported: 4.1 | 10 December 2001 | 12 March 2002 | |
| Unsupported: 4.2 | 22 April 2002 | 6 September 2002 | |
| Unsupported: 4.3 | 27 December 2002 | 31 March 2005 | |
| Unsupported: 4.4 | 11 July 2005 | 7 August 2008 | |
| Unsupported: 5.0 | 13 July 2004 | 5 September 2005 | |
| Unsupported: 5.1 | 24 November 2005 | 24 August 2006 | |
| Unsupported: 5.2 | 2 November 2006 | 6 January 2011 | |
| Unsupported: 5.3 | 30 June 2009 | 14 August 2014 | |
| Unsupported: 5.4 | 1 March 2012 | 3 September 2015 | |
| Unsupported: 5.5 | 20 June 2013 | 10 July 2016 | |
| Unsupported: 5.6 | 28 August 2014 | 31 December 2018 | |
| 6.x | Not released | —N/a | |
| Unsupported: 7.0 | 3 December 2015 | 10 January 2019 | |
| Unsupported: 7.1 | 1 December 2016 | 1 December 2019 | |
| Unsupported: 7.2 | 30 November 2017 | 30 November 2020 | |
| Unsupported: 7.3 | 6 December 2018 | 6 December 2021 | |
| Unsupported: 7.4 | 28 November 2019 | 28 November 2022 | |
| Unsupported: 8.0 | 26 November 2020 | 26 November 2023 | |
| Unsupported: 8.1 | 25 November 2021 | 31 December 2025 | |
| Supported: 8.2 | 8 December 2022 | 31 December 2026 | |
| Supported: 8.3 | 23 November 2023 | 31 December 2027 | |
| Supported: 8.4 | 21 November 2024 | 31 December 2028 | |
| Latest version: 8.5 | 20 November 2025 | 31 December 2029 | |
Legend: Unsupported Supported Latest version Preview version Future version | |||
Mascot
The mascot of the PHP project is the elePHPant, a blue elephant with the PHP logo on its side. It was designed by Vincent Pontier in 1998. When you look at the PHP letters from the side, they look like an elephant.
The elePHPant comes in different colors, often as plush toys. Many versions of this mascot have been made, but only those based on Vincent Pontier's original design are official. These elePHPants are collectable, and some rare ones are hard to find.
Syntax
PHP is a language used to build websites. You can mix PHP code with HTML to make pages change based on what the user does. PHP code goes inside special tags, and only that code is read by the PHP interpreter. Everything else shows up as normal content.
Variables in PHP start with a dollar sign ($). You do not need to tell PHP what kind of information a variable will hold before you use it. PHP can work with many kinds of data, like whole numbers, decimals, and text. It also has special types for true/false values and for handling things like files or databases.
Implementations
The main version of PHP is called PHP. It uses the Zend Engine to run PHP code. The Zend Engine changes PHP code into a special format for computers.
Tools like Zend Opcache help PHP run faster. They store already-processed code so it doesn’t need to be processed again. There are other versions of PHP made by different groups. One example is HHVM, created by Facebook. It changes PHP code into another format to make it run faster. Other tools like Parrot, PeachPie, Phalanger, and Quercus also try new ways to run PHP code quickly.
Licensing
PHP is free software under the PHP License. This license is similar to the 3-clause BSD license. Older versions of PHP had stricter rules, which made them less easy to use with other software.
Development and community
PHP works with many free and open-source libraries. It has tools to connect with servers and databases like PostgreSQL, MySQL, Microsoft SQL Server, and SQLite. Developers can add new features to PHP by writing extensions in the C programming language. These extensions can be added to PHP or loaded when needed.
PHP is mainly used for building websites, but it can also be used for other tasks. There are community projects that help make creating these extensions easier. The PHP Group helps guide the language and includes developers who have contributed to PHP over the years.
The PHP Foundation
On 26 November 2021, the JetBrains blog announced the creation of The PHP Foundation. This group helps make and improve PHP. The foundation employs "Core Developers" to work on PHP’s main code.
Germany's Sovereign Tech Fund gave more than 200,000 Euros to support the PHP Foundation.
People have been happy about the foundation. They say it will help keep PHP going strong and support its community.
Installation and configuration
PHP can be added to a web server in two ways. It can work as a part of the server, or as a separate program the server uses when needed. Popular web servers like Apache HTTP Server and Microsoft IIS can work with PHP. If a server cannot work with PHP this way, PHP can still be used as a separate program.
PHP also has tools to run commands from the computer's command line. It can be used to make programs that are not on a web server. There are many settings to change how PHP works. These settings are usually in a file called php.ini.
Use
PHP is a scripting language that is good for making websites. It can run on many kinds of computers and works with many databases. People use PHP to make web pages change based on what the visitor does, like showing different news or pictures.
PHP is very popular for building websites. Many big website tools, like WordPress and Drupal, use PHP. PHP is used by most websites that need a programming language to work behind the scenes. It is free to use, and many people around the world help improve it all the time.
Security
PHP has had security issues in the past. Some old settings made websites easier to hack, but these are no longer used.
PHP can sometimes mix up numbers and text in ways that might let hackers break into websites. Developers should use special functions to keep things safe.
Cryptographic security
PHP used to have functions for random numbers that were not very safe. Now there is a better function called random_int() that is safer to use.
Long-term support
PHP gets regular updates to fix problems. Each small version gets updates for two years, and then only important security updates for another two years. After that, PHP stops getting updates unless special paid support is bought from companies like Zend.
Images
Related articles
This article is a child-friendly adaptation of the Wikipedia article on PHP, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.
Safekipedia