PHP
Encyclopedia
PHP is a general-purpose server-side scripting language
originally designed for web development
to produce dynamic web page
s. For this purpose, PHP code is embedded into the HTML
source document and interpreted by a web server
with a PHP processor module, which generates the web page
document. It also has evolved to include a command-line interface
capability and can be used in standalone graphical applications
. PHP can be deployed on most web servers and as a standalone interpreter, on almost every operating system
and platform
free of charge. There is also commercial software such as RadPHP, a rapid application development
framework
for the PHP language. A competitor to Microsoft
's Active Server Pages
(ASP) server-side script engine and similar languages, PHP is installed on more than 20 million websites and 1 million web server
s.
PHP was originally created by Rasmus Lerdorf
in 1995. The main implementation of PHP is now produced by The PHP Group and serves as the de facto standard
for PHP as there is no formal specification
. PHP is free software
released under the PHP License
which is incompatible with the GNU General Public License
(GPL) due to restrictions on the usage of the term PHP.
While PHP originally stood for "Personal Home Page", it is now said to stand for "PHP: Hypertext Preprocessor", a recursive acronym
.
ic/Canadian
programmer Rasmus Lerdorf
initially created a set of Perl
scripts he called "Personal Home Page Tools" to maintain his personal homepage. The scripts performed tasks such as displaying his résumé and recording his web-page traffic
. Lerdorf initially announced the release of PHP on the comp.infosystems.www.authoring.cgi Usenet
discussion group on June 8, 1995.
Zeev Suraski
and Andi Gutmans
, two Israel
i developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite
of PHP's core, producing the Zend Engine
in 1999. They also founded Zend Technologies
in Ramat Gan, Israel.
In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.
A new major version has been under development alongside PHP 5 for several years. This version was originally planned to be released as PHP 6 as a result of its significant changes, which included plans for full Unicode support. However, Unicode support took developers much longer to implement than originally thought, and the decision was made in March 2010 to move the project to a branch, with features still under development moved to trunk
.
Changes in the new code include the removal of
, and safe mode. The reason for the removals was that register_globals had opened security holes by intentionally allowing runtime data injection, and the use of magic quotes had an unpredictable nature. Instead, to escape characters, magic quotes may be replaced with the addslashes function, or more appropriately an escape mechanism specific to the database vendor itself like mysql_real_escape_string for MySQL
. Functions that will be removed in future versions and have been deprecated in PHP 5.3 will produce a warning if used.
Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.
PHP does not have native support for Unicode
or multibyte strings; Unicode support is under development for a future version of PHP and will allow strings as well as class-, method-, and function-names to contain non-ASCII
characters.
PHP interpreters are available on both 32-bit
and 64-bit
operating systems, but on Microsoft Windows
the only official distribution is a 32-bit implementation, requiring Windows 32-bit compatibility mode while using Internet Information Services
(IIS) on a 64-bit Windows platform. Experimental 64-bit versions of PHP 5.3.0 were briefly available for MS Windows, but have since been removed.
released under the PHP License
, which insists that:
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
This restriction on use of the name PHP makes it incompatible with the GNU General Public License
(GPL).
Beginning on June 28th, 2011, the PHP Group began following a timeline for when new versions of PHP will be released. Under this timeline, at least one release should occur every month. Every one year, a minor release should occur which can include new features. Every minor release should at least have 2 years of security and bug fixes, followed by at least 1 year of only security fixes, for a total of a 3 year release process for every minor release. No new features (unless small and self contained) will be introduced into a minor release during the 3 year release process.
web development
where PHP generally runs on a web server
. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page
content or dynamic images used on web sites or elsewhere. It can also be used for command-line scripting and client-side
GUI
applications. PHP can be deployed on most web server
s, many operating system
s and platforms
, and can be used with many relational database management system
s (RDBMS). It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.
PHP acts primarily as a filter
, taking input from a file or stream containing text and/or PHP instructions and outputting another stream of data; most commonly the output will be HTML. Since PHP 4, the PHP parser compiles
input to produce bytecode
for processing by the Zend Engine
, giving improved performance over its interpreter
predecessor.
Originally designed to create dynamic web pages, PHP now focuses mainly on server-side scripting
, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client
, such as Microsoft
's ASP.NET
, Sun Microsystems
' JavaServer Pages
, and mod perl
. PHP has also attracted the development of many frameworks
that provide building blocks and a design structure to promote rapid application development
(RAD). Some of these include CakePHP
, Symfony
, CodeIgniter, and Zend Framework
, offering features similar to other web application frameworks.
The LAMP
architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the P in this bundle alongside Linux
, Apache
and MySQL
, although the P may also refer to Python
or Perl
or some combination of the three. Similar packages are also available for Windows
and Mac OS X
, then called WAMP
and MAMP
, with the first letter standing for the respective operating system.
As of April 2007, over 20 million Internet domains had web services hosted on servers with PHP installed and mod_php was recorded as the most popular Apache HTTP Server
module.
PHP is used as the server-side programming language on 75% of all web servers. Web content management system
s written in PHP include MediaWiki
,
Joomla,
eZ Publish
,
WordPress
, Drupal
and Moodle
.
All websites created using these tools are written in PHP, including the user-facing portion of
Wikipedia
, Facebook
,
and Digg
.
to detect automatically the lack of input validation
which induces many issues. Such a feature is being developed for PHP, but its inclusion in a release has been rejected several times in the past.
Hosting PHP applications on a server requires careful and constant attention to
deal with these security risks. There are advanced protection patches such as Suhosin
and Hardening-Patch, especially designed for web hosting environments.
PHPIDS
adds security to any PHP application to defend against intrusions. PHPIDS detects Cross-site scripting
(XSS), SQL injection
, header injection, Directory traversal
, Remote File Execution, Local File Inclusion, Denial of Service (DoS).
PHP Test
echo 'Hello World';
/* echo("Hello World"); works as well,
although echo is not a function, but a
language construct. In some cases, such
as when multiple parameters are passed
to echo, parameters cannot be enclosed
in parentheses. */
?>
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...
originally designed for web development
Web development
Web development is a broad term for the work involved in developing a web site for the Internet or an intranet . This can include web design, web content development, client liaison, client-side/server-side scripting, web server and network security configuration, and e-commerce development...
to produce dynamic web page
Dynamic web page
A dynamic web page is a kind of web page that has been prepared with fresh information , for each individual viewing. It is not static because it changes with the time , the user , the user interaction , the context A dynamic web page is a kind of web page that has been prepared with fresh...
s. For this purpose, PHP code is embedded into the HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
source document and interpreted by a web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
with a PHP processor module, which generates the web page
Web page
A web page or webpage is a document or information resource that is suitable for the World Wide Web and can be accessed through a web browser and displayed on a monitor or mobile device. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext...
document. It also has evolved to include a command-line interface
Command-line interface
A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks...
capability and can be used in standalone graphical applications
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
. PHP can be deployed on most web servers and as a standalone interpreter, on almost every operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
and platform
Platform (computing)
A computing platform includes some sort of hardware architecture and a software framework , where the combination allows software, particularly application software, to run...
free of charge. There is also commercial software such as RadPHP, a rapid application development
Rapid application development
Rapid application development is a software development methodology that uses minimal planning in favor of rapid prototyping. The "planning" of software developed using RAD is interleaved with writing the software itself...
framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...
for the PHP language. A competitor to Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
's Active Server Pages
Active Server Pages
Active Server Pages , also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically-generated Web pages. Initially released as an add-on to Internet Information Services via the Windows NT 4.0 Option Pack Active Server Pages (ASP), also known as Classic...
(ASP) server-side script engine and similar languages, PHP is installed on more than 20 million websites and 1 million web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
s.
PHP was originally created by Rasmus Lerdorf
Rasmus Lerdorf
Rasmus Lerdorf is a Danish programmer with Canadian citizenship and is most notable as the creator of the PHP scripting language. He authored the first two versions...
in 1995. The main implementation of PHP is now produced by The PHP Group and serves as the de facto standard
De facto standard
A de facto standard is a custom, convention, product, or system that has achieved a dominant position by public acceptance or market forces...
for PHP as there is no formal specification
Formal specification
In computer science, a formal specification is a mathematical description of software or hardware that may be used to develop an implementation. It describes what the system should do, not how the system should do it...
. PHP is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
released under the PHP License
PHP License
The PHP License is the software license under which the PHP scripting language is released. The PHP License is a non-copyleft free software license according to the Free Software Foundation and an open source license according to the Open Source Initiative...
which is incompatible with the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
(GPL) due to restrictions on the usage of the term PHP.
While PHP originally stood for "Personal Home Page", it is now said to stand for "PHP: Hypertext Preprocessor", a recursive acronym
Recursive acronym
A recursive acronym is an acronym or initialism that refers to itself in the expression for which it stands...
.
History
PHP development began in 1994 when the Danish/GreenlandGreenland
Greenland is an autonomous country within the Kingdom of Denmark, located between the Arctic and Atlantic Oceans, east of the Canadian Arctic Archipelago. Though physiographically a part of the continent of North America, Greenland has been politically and culturally associated with Europe for...
ic/Canadian
Canada
Canada is a North American country consisting of ten provinces and three territories. Located in the northern part of the continent, it extends from the Atlantic Ocean in the east to the Pacific Ocean in the west, and northward into the Arctic Ocean...
programmer Rasmus Lerdorf
Rasmus Lerdorf
Rasmus Lerdorf is a Danish programmer with Canadian citizenship and is most notable as the creator of the PHP scripting language. He authored the first two versions...
initially created a set of Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...
scripts he called "Personal Home Page Tools" to maintain his personal homepage. The scripts performed tasks such as displaying his résumé and recording his web-page traffic
Web traffic
Web traffic is the amount of data sent and received by visitors to a web site. It is a large portion of Internet traffic. This is determined by the number of visitors and the number of pages they visit...
. Lerdorf initially announced the release of PHP on the comp.infosystems.www.authoring.cgi Usenet
Usenet
Usenet is a worldwide distributed Internet discussion system. It developed from the general purpose UUCP architecture of the same name.Duke University graduate students Tom Truscott and Jim Ellis conceived the idea in 1979 and it was established in 1980...
discussion group on June 8, 1995.
Zeev Suraski
Zeev Suraski
Zeev Suraski is an Israeli programmer, PHP developer and co-founder of Zend Technologies. A graduate of the Technion in Haifa, Israel, Suraski and fellow student Andi Gutmans created PHP 3 in 1997. In 1999 they wrote the Zend Engine, the core of PHP 4, and founded Zend Technologies, which has...
and Andi Gutmans
Andi Gutmans
Andi Gutmans is an Israeli programmer with Swiss roots, PHP developer and co-founder of Zend Technologies. A graduate of the Technion, the Israel Institute of Technology in Haifa, Gutmans and fellow student Zeev Suraski created PHP 3 in 1997...
, two Israel
Israel
The State of Israel is a parliamentary republic located in the Middle East, along the eastern shore of the Mediterranean Sea...
i developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite
Rewrite (programming)
A rewrite in computer programming is the act or result of re-implementing a large portion of existing functionality without re-use of its source code. When the rewrite is not using existing code at all, it is common to speak of a rewrite from scratch...
of PHP's core, producing the Zend Engine
Zend engine
The Zend Engine is an open source scripting engine , commonly known for the important role it plays in the web automation language PHP. It was originally developed by Andi Gutmans and Zeev Suraski while they were students at the Technion - Israel Institute of Technology. They later founded a...
in 1999. They also founded Zend Technologies
Zend Technologies
Zend Technologies Ltd. is an Israeli world wide web infrastructure software company with headquarters in Cupertino, California, U.S., technology center in Ramat Gan, Tel Aviv, Israel and offices in France, Italy and Germany...
in Ramat Gan, Israel.
In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.
A new major version has been under development alongside PHP 5 for several years. This version was originally planned to be released as PHP 6 as a result of its significant changes, which included plans for full Unicode support. However, Unicode support took developers much longer to implement than originally thought, and the decision was made in March 2010 to move the project to a branch, with features still under development moved to trunk
Trunk (software)
In the field of software development, trunk refers to the unnamed branch of a file tree under revision control. The trunk is usually meant to be the base of a project on which development progresses. If developers are working exclusively on the trunk, it always contains the latest cutting-edge...
.
Changes in the new code include the removal of
register_globals
, magic quotesMagic quotes
Magic quotes is a controversial feature of the PHP scripting language, which was introduced to help newcomers write functioning SQL commands without requiring manual escaping. It was later described and widely misinterpreted as help to prevent inexperienced developers from writing code which is...
, and safe mode. The reason for the removals was that register_globals had opened security holes by intentionally allowing runtime data injection, and the use of magic quotes had an unpredictable nature. Instead, to escape characters, magic quotes may be replaced with the addslashes function, or more appropriately an escape mechanism specific to the database vendor itself like mysql_real_escape_string for MySQL
MySQL
MySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My...
. Functions that will be removed in future versions and have been deprecated in PHP 5.3 will produce a warning if used.
Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.
PHP does not have native support for Unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
or multibyte strings; Unicode support is under development for a future version of PHP and will allow strings as well as class-, method-, and function-names to contain non-ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...
characters.
PHP interpreters are available on both 32-bit
32-bit
The range of integer values that can be stored in 32 bits is 0 through 4,294,967,295. Hence, a processor with 32-bit memory addresses can directly access 4 GB of byte-addressable memory....
and 64-bit
64-bit
64-bit is a word size that defines certain classes of computer architecture, buses, memory and CPUs, and by extension the software that runs on them. 64-bit CPUs have existed in supercomputers since the 1970s and in RISC-based workstations and servers since the early 1990s...
operating systems, but on Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
the only official distribution is a 32-bit implementation, requiring Windows 32-bit compatibility mode while using Internet Information Services
Internet Information Services
Internet Information Services – formerly called Internet Information Server – is a web server application and set of feature extension modules created by Microsoft for use with Microsoft Windows. It is the most used web server after Apache HTTP Server. IIS 7.5 supports HTTP, HTTPS,...
(IIS) on a 64-bit Windows platform. Experimental 64-bit versions of PHP 5.3.0 were briefly available for MS Windows, but have since been removed.
Licensing
PHP is free softwareFree software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
released under the PHP License
PHP License
The PHP License is the software license under which the PHP scripting language is released. The PHP License is a non-copyleft free software license according to the Free Software Foundation and an open source license according to the Open Source Initiative...
, which insists that:
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
This restriction on use of the name PHP makes it incompatible with the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
(GPL).
Release history
Meaning | |
---|---|
Red | Release no longer supported |
Green | Release still supported |
Blue | Future release |
Major version | Minor version | Release date | Notes |
---|---|---|---|
1 | 1.0.0 | Officially called "Personal Home Page Tools (PHP Tools)". This is the first use of the name "PHP". | |
2 | 2.0.0 | Considered by its creator as the "fastest and simplest tool" for creating dynamic web pages. | |
3 | 3.0.0 | Development moves from one person to multiple developers. Zeev Suraski and Andi Gutmans rewrite the base for this version. | |
3.0.18 | The latest release for PHP 3.0.x. Unsupported Historical Releases | ||
4 | 4.0.0 | Added more advanced two-stage parse/execute tag-parsing system called the Zend engine. | |
4.1.0 | Introduced 'superglobals' ($_GET , $_POST , $_SESSION , etc.) |
||
4.2.0 | Disabled register_globals by default. Data received over the network is not inserted directly into the globalGlobal variable In computer programming, a global variable is a variable that is accessible in every scope . Interaction mechanisms with global variables are called global environment mechanisms... namespace anymore, closing possible security holes in applications. |
||
4.3.0 | Introduced the CLI Command-line interface A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks... , in addition to the CGI Common Gateway Interface The Common Gateway Interface is a standard method for web servers software to delegate the generation of web pages to executable files... . |
||
4.4.0 | Added man pages for phpize and php-config scripts. |
||
4.4.9 | Security enhancements and bug fixes. The last release of the PHP 4.4 series. | ||
5 | 5.0.0 | Zend Engine II with a new object model. | |
5.1.0 | Performance improvements with introduction of compiler variables in re-engineered PHP Engine. Added PHP Data Objects (PDO) as a consistent interface for accessing databases. | ||
5.2.0 | Enabled the filter extension by default. Native JSON JSON JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects... support. |
||
5.2.17 | Fix of critical vulnerability connected to floating point. | ||
5.3.0 | Namespace Namespace (computer science) A namespace is an abstract container or environment created to hold a logical grouping of unique identifiers or symbols . An identifier defined in a namespace is associated only with that namespace. The same identifier can be independently defined in multiple namespaces... support; Late static bindings Name binding In programming languages, name binding is the association of objects with identifiers. An identifier bound to an object is said to reference that object. Machine languages have no built-in notion of identifiers, but name-object bindings as a service and notation for the programmer is implemented... , Jump label (limited goto Goto goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control... ), Native closures Closure (computer science) In computer science, a closure is a function together with a referencing environment for the non-local variables of that function. A closure allows a function to access variables outside its typical scope. Such a function is said to be "closed over" its free variables... , Native PHP archives (phar), garbage collection Garbage collection (computer science) In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program... for circular references, improved Windows Microsoft Windows Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal... support, sqlite3, mysqlnd as a replacement for libmysql as underlying library for the extensions that work with MySQL MySQL MySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My... , fileinfo as a replacement for mime_magic for better MIME MIME Multipurpose Internet Mail Extensions is an Internet standard that extends the format of email to support:* Text in character sets other than ASCII* Non-text attachments* Message bodies with multiple parts... support, the Internationalization extension, and deprecation of ereg extension. |
||
5.3.1 | Over 100 bug fixes, some of which were security fixes. | ||
5.3.2 | Includes a large number of bug fixes. | ||
5.3.3 | Mainly bug and security fixes; FPM PHP-FPM PHP-FPM is a PHP FastCGI implementation.It is bundled with the official PHP distribution since version 5.3.3.- External Links :* *... SAPI. |
||
5.3.4 | Mainly bug and security fixes; improvements to FPM PHP-FPM PHP-FPM is a PHP FastCGI implementation.It is bundled with the official PHP distribution since version 5.3.3.- External Links :* *... SAPI. |
||
5.3.5 | Fix of critical vulnerability connected to floating point. | ||
5.3.6 | Over 60 bug fixes that were reported in the previous version. | ||
5.3.7 | This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related. | ||
5.3.8 | This release fixes two issues introduced in the PHP 5.3.7 release. | ||
5.4.0 RC2 | Trait Support, Removed items: register_globals , safe_mode , allow_call_time_pass_reference , session_register , session_unregister and session_is_registered . Several improvements to existing features. |
||
6 | ?.? | No date set | The development of PHP 6 has been delayed because the developers have decided the current approach to handling of instance unicode is not a good one, and are considering alternate ways in the next version of PHP. The updates that were intended for PHP 6 were added to PHP 5.3.0(namespace support, Late Static Bindings, lambda functions, closures, goto) and 5.4.0(traits, closure rebinding) instead. |
Beginning on June 28th, 2011, the PHP Group began following a timeline for when new versions of PHP will be released. Under this timeline, at least one release should occur every month. Every one year, a minor release should occur which can include new features. Every minor release should at least have 2 years of security and bug fixes, followed by at least 1 year of only security fixes, for a total of a 3 year release process for every minor release. No new features (unless small and self contained) will be introduced into a minor release during the 3 year release process.
Usage
PHP is a general-purpose scripting language that is especially suited to server-sideServer-side scripting
Server-side scripting is a web server technology in which a user's request is verified by running a script directly on the web server to generate dynamic web pages. It is usually used to provide interactive web sites that interface to databases or other data stores. This is different from...
web development
Web development
Web development is a broad term for the work involved in developing a web site for the Internet or an intranet . This can include web design, web content development, client liaison, client-side/server-side scripting, web server and network security configuration, and e-commerce development...
where PHP generally runs on a web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page
Dynamic web page
A dynamic web page is a kind of web page that has been prepared with fresh information , for each individual viewing. It is not static because it changes with the time , the user , the user interaction , the context A dynamic web page is a kind of web page that has been prepared with fresh...
content or dynamic images used on web sites or elsewhere. It can also be used for command-line scripting and client-side
Client-side
Client-side refers to operations that are performed by the client in a client–server relationship in a computer network.Typically, a client is a computer application, such as a web browser, that runs on a user's local computer or workstation and connects to a server as necessary...
GUI
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
applications. PHP can be deployed on most web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
s, many operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
s and platforms
Platform (computing)
A computing platform includes some sort of hardware architecture and a software framework , where the combination allows software, particularly application software, to run...
, and can be used with many relational database management system
Relational database management system
A relational database management system is a database management system that is based on the relational model as introduced by E. F. Codd. Most popular databases currently in use are based on the relational database model....
s (RDBMS). It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.
PHP acts primarily as a filter
Filter (software)
A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built into its command shell, most of which have significant enhancements relative to the similar filter commands that were available in...
, taking input from a file or stream containing text and/or PHP instructions and outputting another stream of data; most commonly the output will be HTML. Since PHP 4, the PHP parser compiles
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...
input to produce bytecode
Bytecode
Bytecode, also known as p-code , is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software interpreter as well as being suitable for further compilation into machine code...
for processing by the Zend Engine
Zend engine
The Zend Engine is an open source scripting engine , commonly known for the important role it plays in the web automation language PHP. It was originally developed by Andi Gutmans and Zeev Suraski while they were students at the Technion - Israel Institute of Technology. They later founded a...
, giving improved performance over its interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...
predecessor.
Originally designed to create dynamic web pages, PHP now focuses mainly on server-side scripting
Server-side scripting
Server-side scripting is a web server technology in which a user's request is verified by running a script directly on the web server to generate dynamic web pages. It is usually used to provide interactive web sites that interface to databases or other data stores. This is different from...
, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client
Client (computing)
A client is an application or system that accesses a service made available by a server. The server is often on another computer system, in which case the client accesses the service by way of a network....
, such as Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
's ASP.NET
ASP.NET
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...
, Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...
' JavaServer Pages
JavaServer Pages
JavaServer Pages is a Java technology that helps software developers serve dynamically generated web pages based on HTML, XML, or other document types...
, and mod perl
Mod perl
mod_perl is an optional module for the Apache HTTP server. It embeds a Perl interpreter into the Apache server, so that dynamic content produced by Perl scripts can be served in response to incoming requests, without the significant overhead of re-launching the Perl interpreter for each request...
. PHP has also attracted the development of many frameworks
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...
that provide building blocks and a design structure to promote rapid application development
Rapid application development
Rapid application development is a software development methodology that uses minimal planning in favor of rapid prototyping. The "planning" of software developed using RAD is interleaved with writing the software itself...
(RAD). Some of these include CakePHP
CakePHP
CakePHP is an open source web application framework for producing web applications. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License.-History:...
, Symfony
Symfony
Symfony is a web application framework written in PHP which follows the model-view-controller paradigm. Released under the MIT license, Symfony is free software...
, CodeIgniter, and Zend Framework
Zend Framework
Zend Framework is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.-Licensing:...
, offering features similar to other web application frameworks.
The LAMP
LAMP (software bundle)
LAMP is an acronym for a solution stack of free, open source software, referring to the first letters of Linux , Apache HTTP Server, MySQL and PHP , principal components to build a viable general purpose web server.The GNU project is advocating people to use the term "GLAMP" since what is known as...
architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the P in this bundle alongside Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
, Apache
Apache HTTP Server
The Apache HTTP Server, commonly referred to as Apache , is web server software notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million website milestone...
and MySQL
MySQL
MySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My...
, although the P may also refer to Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
or Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...
or some combination of the three. Similar packages are also available for Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
, then called WAMP
WAMP
WAMPs are packages of independently-created programs installed on computers that use a Microsoft Windows operating system.WAMP is an acronym formed from the initials of the operating system Microsoft Windows and the principal components of the package: Apache, MySQL and one of PHP, Perl or Python....
and MAMP
MAMP
The acronym MAMP refers to a set of free software programs commonly used together to run dynamic web sites on servers running the Apple Macintosh operating system, Mac OS X:* Mac OS X, the operating system;* Apache, the Web server;...
, with the first letter standing for the respective operating system.
As of April 2007, over 20 million Internet domains had web services hosted on servers with PHP installed and mod_php was recorded as the most popular Apache HTTP Server
Apache HTTP Server
The Apache HTTP Server, commonly referred to as Apache , is web server software notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million website milestone...
module.
PHP is used as the server-side programming language on 75% of all web servers. Web content management system
Web content management system
A web content management system is a software system that provides website authoring, collaboration, and administration tools designed to allow users with little knowledge of web programming languages or markup languages to create and manage website content with relative ease...
s written in PHP include MediaWiki
MediaWiki
MediaWiki is a popular free web-based wiki software application. Developed by the Wikimedia Foundation, it is used to run all of its projects, including Wikipedia, Wiktionary and Wikinews. Numerous other wikis around the world also use it to power their websites...
,
Joomla,
eZ Publish
EZ publish
-External links:* * * * * *...
,
WordPress
WordPress
WordPress is a free and open source blogging tool and publishing platform powered by PHP and MySQL. It is often customized into a content management system . It has many features including a plug-in architecture and a template system. WordPress is used by over 14.7% of Alexa Internet's "top 1...
, Drupal
Drupal
Drupal is a free and open-source content management system and content management framework written in PHP and distributed under the GNU General Public License. It is used as a back-end system for at least 1.5% of all websites worldwide ranging from personal blogs to corporate, political, and...
and Moodle
Moodle
Moodle is a free source e-learning software platform, also known as a Course Management System, Learning Management System, or Virtual Learning Environment...
.
All websites created using these tools are written in PHP, including the user-facing portion of
Wikipedia
Wikipedia
Wikipedia is a free, web-based, collaborative, multilingual encyclopedia project supported by the non-profit Wikimedia Foundation. Its 20 million articles have been written collaboratively by volunteers around the world. Almost all of its articles can be edited by anyone with access to the site,...
Facebook
Facebook is a social networking service and website launched in February 2004, operated and privately owned by Facebook, Inc. , Facebook has more than 800 million active users. Users must register before using the site, after which they may create a personal profile, add other users as...
,
and Digg
Digg
Digg is a social news website. Prior to Digg v4, its cornerstone function consisted of letting people vote stories up or down, called digging and burying, respectively. Digg's popularity prompted the creation of copycat social networking sites with story submission and voting systems...
.
Security
Vulnerabilities are caused mostly by not following best practice programming rules: technical security flaws of the language itself or of its core libraries are not frequent (23 in 2008, about 1% of the total). Recognizing that programmers cannot be trusted, some languages include taint checkingTaint checking
Taint checking is a feature in some computer programming languages, such as Perl and Ruby, designed to increase security by preventing malicious users from executing commands on a host computer...
to detect automatically the lack of input validation
Data validation
In computer science, data validation is the process of ensuring that a program operates on clean, correct and useful data. It uses routines, often called "validation rules" or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system...
which induces many issues. Such a feature is being developed for PHP, but its inclusion in a release has been rejected several times in the past.
Hosting PHP applications on a server requires careful and constant attention to
deal with these security risks. There are advanced protection patches such as Suhosin
Suhosin
Suhosin is an open source patch for PHP."The goal behind Suhosin is to be a safety net that protects servers from insecure PHP coding practices."In some Linux distributions it is shipped by default....
and Hardening-Patch, especially designed for web hosting environments.
PHPIDS
PHPIDS
PHPIDS is an open source PHP Web Application Intrusion Detection System. It was written by Mario Heiderich, Christian Matthies, Lars H. Strojny and several others in March 2007...
adds security to any PHP application to defend against intrusions. PHPIDS detects Cross-site scripting
Cross-site scripting
Cross-site scripting is a type of computer security vulnerability typically found in Web applications that enables attackers to inject client-side script into Web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same...
(XSS), SQL injection
SQL injection
A SQL injection is often used to attack the security of a website by inputting SQL statements in a web form to get a badly designed website in order to dump the database content to the attacker. SQL injection is a code injection technique that exploits a security vulnerability in a website's software...
, header injection, Directory traversal
Directory traversal
A directory traversal consists in exploiting insufficient security validation / sanitization of user-supplied input file names, so that characters representing "traverse to parent directory" are passed through to the file APIs....
, Remote File Execution, Local File Inclusion, Denial of Service (DoS).
Syntax
echo 'Hello World';
/* echo("Hello World"); works as well,
although echo is not a function, but a
language construct. In some cases, such
as when multiple parameters are passed
to echo, parameters cannot be enclosed
in parentheses. */
?>