Safekipedia

PHP

Adapted from Wikipedia · Adventurer experience

Official PHP Logo. Main color:   Gradient on the outside:    

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.

An example of PHP code for the WordPress content management system.

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.

VersionRelease dateSupported until
Unsupported: 1.08 June 1995
Unsupported: 2.01 November 1997
Unsupported: 3.06 June 199820 October 2000
Unsupported: 4.022 May 200023 June 2001
Unsupported: 4.110 December 200112 March 2002
Unsupported: 4.222 April 20026 September 2002
Unsupported: 4.327 December 200231 March 2005
Unsupported: 4.411 July 20057 August 2008
Unsupported: 5.013 July 20045 September 2005
Unsupported: 5.124 November 200524 August 2006
Unsupported: 5.22 November 20066 January 2011
Unsupported: 5.330 June 200914 August 2014
Unsupported: 5.41 March 20123 September 2015
Unsupported: 5.520 June 201310 July 2016
Unsupported: 5.628 August 201431 December 2018
6.xNot released—N/a
Unsupported: 7.03 December 201510 January 2019
Unsupported: 7.11 December 20161 December 2019
Unsupported: 7.230 November 201730 November 2020
Unsupported: 7.36 December 20186 December 2021
Unsupported: 7.428 November 201928 November 2022
Unsupported: 8.026 November 202026 November 2023
Unsupported: 8.125 November 202131 December 2025
Supported: 8.28 December 202231 December 2026
Supported: 8.323 November 202331 December 2027
Supported: 8.421 November 202431 December 2028
Latest version: 8.520 November 202531 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.

YearCommitsReviewsRFCs
20226832838
202378470217
20241976127813

Installation and configuration

Example output of the phpinfo() function in PHP 7.1

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

Portrait of Rasmus Lerdahl at a technology conference.
Portrait of Andi Gutmans, a professional photographer.
Zeev Suraski, a key contributor to the PHP programming language, speaking at a technology conference in Paris in 2005.

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.