<p><b>PHP</b> (<i>PHP: Hypertext Preprocessor</i>) is a computer <atarget="_blank"href="http://en.wikipedia.org/Scripting_language"title="Scripting language">scripting language</a>, originally designed for producing <atarget="_blank"href="http://en.wikipedia.org/Dynamic_web_page"title="Dynamic web page">dynamic web pages</a>. It is mainly used in <atarget="_blank"href="http://en.wikipedia.org/Server-side_scripting"title="Server-side scripting">server-side scripting</a>, but can be used from a <atarget="_blank"href="http://en.wikipedia.org/Command_line_interface"title="Command line interface">command line interface</a> or in <atarget="_blank"href="http://en.wikipedia.org/Standalone"title="Standalone">standalone</a><atarget="_blank"href="http://en.wikipedia.org/Graphical_user_interface"title="Graphical user interface">graphical applications</a>.<supid="cite_ref-1"class="reference"><ahref="#cite_note-1"title="">[2]</a></sup></p>
<p>While PHP was originally created by <atarget="_blank"href="http://en.wikipedia.org/Rasmus_Lerdorf"title="Rasmus Lerdorf">Rasmus Lerdorf</a> in 1994, the main implementation of PHP is now produced by The PHP Group and serves as the <atarget="_blank"href="http://en.wikipedia.org/De_facto_standard"title="De facto standard"><i>de facto</i> standard</a> for PHP as there is no <atarget="_blank"href="http://en.wikipedia.org/Formal_specification"title="Formal specification">formal specification</a>.<supid="cite_ref-history_2-0"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup> Released under the <atarget="_blank"href="http://en.wikipedia.org/PHP_License"title="PHP License">PHP License</a>, the <atarget="_blank"href="http://en.wikipedia.org/Free_Software_Foundation"title="Free Software Foundation">Free Software Foundation</a> considers it to be <atarget="_blank"href="http://en.wikipedia.org/Free_software"title="Free software">free software</a>.<supid="cite_ref-3"class="reference"><ahref="#cite_note-3"title="">[4]</a></sup></p>
<p>PHP is a widely-used general-purpose scripting language that is especially suited for <atarget="_blank"href="http://en.wikipedia.org/Web_development"title="Web development">web development</a> and can be embedded into <atarget="_blank"href="http://en.wikipedia.org/HTML"title="HTML">HTML</a>. It generally runs on a <atarget="_blank"href="http://en.wikipedia.org/Web_server"title="Web server">web server</a>, taking PHP code as its input and creating <atarget="_blank"href="http://en.wikipedia.org/Web_page"title="Web page">web pages</a> as output. It can be deployed on most web servers and on almost every <atarget="_blank"href="http://en.wikipedia.org/Operating_system"title="Operating system">operating system</a> and <atarget="_blank"href="http://en.wikipedia.org/Platform_%28computing%29"class="mw-redirect"title="Platform (computing)">platform</a> free of charge.<supid="cite_ref-foundations_4-0"class="reference"><ahref="#cite_note-foundations-4"title="">[5]</a></sup> PHP is installed on more than 20 million websites and 1 million <atarget="_blank"href="http://en.wikipedia.org/Server_%28computing%29"title="Server (computing)">servers</a>, although the number of websites with PHP <atarget="_blank"href="http://en.wikipedia.org/Installation_%28computer_programs%29"title="Installation (computer programs)">installed</a> has declined since August 2005.<supid="cite_ref-usage_5-0"class="reference"><ahref="#cite_note-usage-5"title="">[6]</a></sup> It is also the most popular <atarget="_blank"href="http://en.wikipedia.org/Apache_HTTP_Server"title="Apache HTTP Server">Apache</a> module among computers using Apache as a web server.<supid="cite_ref-usage_5-1"class="reference"><ahref="#cite_note-usage-5"title="">[6]</a></sup> The most recent major release of PHP was version 5.2.5 on <atarget="_blank"href="http://en.wikipedia.org/November_8"title="November 8">November 8</a>, <atarget="_blank"href="http://en.wikipedia.org/2007"title="2007">2007</a>.<supid="cite_ref-php5changelog_6-0"class="reference"><ahref="#cite_note-php5changelog-6"title="">[7]</a></sup></p>
<divclass="thumbinner"style="width:182px;"><ahref="/wiki/Image:Lerdorf.jpg"class="image"title="Rasmus Lerdorf, who wrote the original Common Gateway Interface binaries"><imgalt="Rasmus Lerdorf, who wrote the original Common Gateway Interface binaries"src="path:180px-Lerdorf.jpg"width="180"height="270"border="0"class="thumbimage"/></a>
<ahref="/wiki/Rasmus_Lerdorf"title="Rasmus Lerdorf">Rasmus Lerdorf</a>, who wrote the original <ahref="/wiki/Common_Gateway_Interface"title="Common Gateway Interface">Common Gateway Interface</a> binaries</div>
</div>
</div>
<p>PHP, standing for Personal Home Page, began as a set of <atarget="_blank"href="http://en.wikipedia.org/Common_Gateway_Interface"title="Common Gateway Interface">Common Gateway Interface</a><atarget="_blank"href="http://en.wikipedia.org/Binary_file"title="Binary file">binaries</a> written in the <atarget="_blank"href="http://en.wikipedia.org/C_programming_language"class="mw-redirect"title="C programming language">C programming language</a> in 1994 by the <atarget="_blank"href="http://en.wikipedia.org/Danish_people"title="Danish people">Danish</a>/<atarget="_blank"href="http://en.wikipedia.org/Greenland"title="Greenland">Greenlandic</a> programmer <atarget="_blank"href="http://en.wikipedia.org/Rasmus_Lerdorf"title="Rasmus Lerdorf">Rasmus Lerdorf</a>. Lerdorf initially created these Personal Home Page Tools to replace a small set of <atarget="_blank"href="http://en.wikipedia.org/Perl"title="Perl">Perl</a> scripts he had been using to maintain his <atarget="_blank"href="http://en.wikipedia.org/Personal_homepage"class="mw-redirect"title="Personal homepage">personal homepage</a>. The tools were originally created to perform tasks such as displaying his <atarget="_blank"href="http://en.wikipedia.org/R%C3%A9sum%C3%A9"title="Résumé">résumé</a> and recording how much <atarget="_blank"href="http://en.wikipedia.org/Web_traffic"title="Web traffic">traffic</a> his page was receiving.<supid="cite_ref-history_2-1"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup> He combined these binaries with his Form Interpreter to create PHP/FI, which had more functionality. It included a larger <atarget="_blank"href="http://en.wikipedia.org/C_%28programming_language%29"title="C (programming language)">C implementation</a> which could communicate with <atarget="_blank"href="http://en.wikipedia.org/Database"title="Database">databases</a> and helped build simple, dynamic <atarget="_blank"href="http://en.wikipedia.org/Web_application"title="Web application">web applications</a>. He released PHP publicly on <atarget="_blank"href="http://en.wikipedia.org/June_8"title="June 8">June 8</a>, <atarget="_blank"href="http://en.wikipedia.org/1995"title="1995">1995</a> to speed up the finding of <atarget="_blank"href="http://en.wikipedia.org/Software_bug"title="Software bug">bugs</a> and improving the code.<supid="cite_ref-7"class="reference"><ahref="#cite_note-7"title="">[8]</a></sup> This release was named PHP version 2, and already had basic functionality that PHP has today. This includes Perl-like variables, form handling, and the ability to embed HTML. The syntax was similar to Perl but was more limited, simpler, and less consistent.<supid="cite_ref-history_2-2"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup></p>
<divclass="help-box help-right">
<divclass="thumbinner"style="width:182px;"><atarget="_blank"href="http://en.wikipedia.org/Image:Andi_Gutmans_1.jpg"class="image"title="Andi Gutmans, who, along with Zeev Suraski, rewrote the parser that formed PHP 3"><imgalt="Andi Gutmans, who, along with Zeev Suraski, rewrote the parser that formed PHP 3"src="path:180px-Andi_Gutmans_1.jpg"width="180"height="244"border="0"class="thumbimage"/></a>
<atarget="_blank"href="http://en.wikipedia.org/Andi_Gutmans"title="Andi Gutmans">Andi Gutmans</a>, who, along with <atarget="_blank"href="http://en.wikipedia.org/Zeev_Suraski"title="Zeev Suraski">Zeev Suraski</a>, rewrote the <atarget="_blank"href="http://en.wikipedia.org/Parser"class="mw-redirect"title="Parser">parser</a> that formed PHP 3</div>
</div>
</div>
<p><atarget="_blank"href="http://en.wikipedia.org/Zeev_Suraski"title="Zeev Suraski">Zeev Suraski</a> and <atarget="_blank"href="http://en.wikipedia.org/Andi_Gutmans"title="Andi Gutmans">Andi Gutmans</a>, two <atarget="_blank"href="http://en.wikipedia.org/Israelis"title="Israelis">Israeli</a> developers at the <atarget="_blank"href="http://en.wikipedia.org/Technion_IIT"class="mw-redirect"title="Technion IIT">Technion IIT</a>, rewrote the <atarget="_blank"href="http://en.wikipedia.org/Parser"class="mw-redirect"title="Parser">parser</a> in 1997 and formed the base of PHP 3, changing the language's name to the <atarget="_blank"href="http://en.wikipedia.org/Recursive_initialism"class="mw-redirect"title="Recursive initialism">recursive initialism</a><i>PHP: Hypertext Preprocessor</i>.<supid="cite_ref-history_2-3"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup> The development team officially released PHP/FI 2 in November 1997 after months of <atarget="_blank"href="http://en.wikipedia.org/Development_stage#beta"class="mw-redirect"title="Development stage">beta</a> testing. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new <atarget="_blank"href="http://en.wikipedia.org/Rewrite_%28programming%29"title="Rewrite (programming)">rewrite</a> of PHP's core, producing the <atarget="_blank"href="http://en.wikipedia.org/Zend_Engine"title="Zend Engine">Zend Engine</a> in 1999.<supid="cite_ref-8"class="reference"><ahref="#cite_note-8"title="">[9]</a></sup> They also founded <atarget="_blank"href="http://en.wikipedia.org/Zend_Technologies"title="Zend Technologies">Zend Technologies</a> in <atarget="_blank"href="http://en.wikipedia.org/Ramat_Gan"title="Ramat Gan">Ramat Gan</a>, Israel, which manages the development of PHP.<supid="cite_ref-history_2-4"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup></p>
<p>On <atarget="_blank"href="http://en.wikipedia.org/May_22"title="May 22">May 22</a>, <atarget="_blank"href="http://en.wikipedia.org/2000"title="2000">2000</a>, PHP 4, powered by the Zend Engine 1.0, was released.<supid="cite_ref-history_2-5"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup> On <atarget="_blank"href="http://en.wikipedia.org/July_13"title="July 13">July 13</a>, <atarget="_blank"href="http://en.wikipedia.org/2004"title="2004">2004</a>, PHP 5 was released and is powered by the new Zend Engine II.<supid="cite_ref-history_2-6"class="reference"><ahref="#cite_note-history-2"title="">[3]</a></sup> PHP 5 included new features such as improved support for <atarget="_blank"href="http://en.wikipedia.org/Object-oriented_programming"title="Object-oriented programming">object-oriented programming</a>, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.<supid="cite_ref-9"class="reference"><ahref="#cite_note-9"title="">[10]</a></sup> The most recent update released by The PHP Group is for the older PHP version 4 code branch. As of January 2008, this branch is up to version 4.4.8. PHP 4 will be supported by security updates until <atarget="_blank"href="http://en.wikipedia.org/August_8"title="August 8">August 8</a>, <atarget="_blank"href="http://en.wikipedia.org/2008"title="2008">2008</a>.<supid="cite_ref-2007_news_10-0"class="reference"><ahref="#cite_note-2007_news-10"title="">[11]</a></sup></p>
<p>PHP 5 is the only stable version still being developed. <atarget="_blank"href="http://en.wikipedia.org/Late_static_binding"class="mw-redirect"title="Late static binding">Late static binding</a> has been missing from PHP and will be added in version 5.3.<supid="cite_ref-11"class="reference"><ahref="#cite_note-11"title="">[12]</a></sup><supid="cite_ref-12"class="reference"><ahref="#cite_note-12"title="">[13]</a></sup> Development on PHP 4 ceased at the end of 2007, except for the critical security updates for PHP 4 already mentioned.<supid="cite_ref-13"class="reference"><ahref="#cite_note-13"title="">[14]</a></sup><supid="cite_ref-2007_news_10-1"class="reference"><ahref="#cite_note-2007_news-10"title="">[11]</a></sup> PHP 6 is now under development and major changes include the removal of <code>register_globals</code><supid="cite_ref-14"class="reference"><ahref="#cite_note-14"title="">[15]</a></sup>, <atarget="_blank"href="http://en.wikipedia.org/Magic_quotes"title="Magic quotes">magic quotes</a>, and <atarget="_blank"href="http://en.wikipedia.org/Safe_mode#Application_software_safe_mode"title="Safe mode">safe mode</a>.<supid="cite_ref-2007_news_10-2"class="reference"><ahref="#cite_note-2007_news-10"title="">[11]</a></sup><supid="cite_ref-15"class="reference"><ahref="#cite_note-15"title="">[16]</a></sup> PHP does not have complete native support for <atarget="_blank"href="http://en.wikipedia.org/Unicode"title="Unicode">Unicode</a> or multibyte strings;<supid="cite_ref-16"class="reference"><ahref="#cite_note-16"title="">[17]</a></sup> unicode support will be added in PHP 6.<supid="cite_ref-17"class="reference"><ahref="#cite_note-17"title="">[18]</a></sup> Many high profile open source projects ceased to support PHP 4 in new code as of <atarget="_blank"href="http://en.wikipedia.org/February_5"title="February 5">February 5</a>, <atarget="_blank"href="http://en.wikipedia.org/2008"title="2008">2008</a>, due to the GoPHP5 initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.<supid="cite_ref-gophp5_18-0"class="reference"><ahref="#cite_note-gophp5-18"title="">[19]</a></sup><supid="cite_ref-19"class="reference"><ahref="#cite_note-19"title="">[20]</a></sup></p>
<p>PHP is a popular target of <atarget="_blank"href="http://en.wikipedia.org/Hacker"title="Hacker">hackers</a> who exploit vulnerable applications written in PHP. Software vulnerabilities related to PHP are identified among the <atarget="_blank"href="http://en.wikipedia.org/Common_Vulnerabilities_and_Exposures"title="Common Vulnerabilities and Exposures">CVE (Common Vulnerabilities and Exposures)</a> records, available from the <atarget="_blank"href="http://en.wikipedia.org/National_Vulnerability_Database"title="National Vulnerability Database">National Vulnerability Database</a>. The proportion of vulnerabilities related to PHP, out of the total of all common vulnerabilities, amounted to: 12% in 2003, 20% in 2004, 28% in 2005, 43% in 2006, 36% in 2007, and 33.8% for the first quarter of 2008. More than a quarter of all software vulnerabilities listed in this database are related to PHP, and more than a third of vulnerabilities listed recently. Most of these vulnerabilities can be exploited remotely, that is without being logged on the computer hosting the vulnerable application.<supid="cite_ref-27"class="reference"><ahref="#cite_note-27"title="">[28]</a></sup> Such exploitation is made possible due to poor programming habits, such as failing to check data before entering it into a database, and features of the language such as <code>register_globals</code>, which is now deprecated.<supid="cite_ref-register_globals_21-1"class="reference"><ahref="#cite_note-register_globals-21"title="">[22]</a></sup> These result in <atarget="_blank"href="http://en.wikipedia.org/Code_injection"title="Code injection">code injection</a>, <atarget="_blank"href="http://en.wikipedia.org/Cross-site_scripting"title="Cross-site scripting">cross-site scripting</a> and other <atarget="_blank"href="http://en.wikipedia.org/Application_security"title="Application security">application security</a> issues. It's important to note that none of these attacks are exclusive to PHP and all are avoidable by following proper coding techniques and principles.</p>
<p>PHP is a general-purpose scripting language that is especially suited for <atarget="_blank"href="http://en.wikipedia.org/Web_development"title="Web development">web development</a>. It is the fourth most popular computer programming language, ranking behind <atarget="_blank"href="http://en.wikipedia.org/Java_%28programming_language%29"title="Java (programming language)">Java</a>, <atarget="_blank"href="http://en.wikipedia.org/C_%28programming_language%29"title="C (programming language)">C</a>, and <atarget="_blank"href="http://en.wikipedia.org/Visual_Basic"title="Visual Basic">Visual Basic</a>.<supid="cite_ref-22"class="reference"><ahref="#cite_note-22"title="">[23]</a></sup> PHP generally runs on a <atarget="_blank"href="http://en.wikipedia.org/Web_server"title="Web server">web server</a>, taking PHP code as its input and creating <atarget="_blank"href="http://en.wikipedia.org/Web_page"title="Web page">web pages</a> as output. It can also be used for <atarget="_blank"href="http://en.wikipedia.org/Command-line"class="mw-redirect"title="Command-line">command-line</a> scripting and <atarget="_blank"href="http://en.wikipedia.org/Client-side"title="Client-side">client-side</a><atarget="_blank"href="http://en.wikipedia.org/Graphical_user_interface"title="Graphical user interface">GUI</a> applications. PHP can be deployed on most <atarget="_blank"href="http://en.wikipedia.org/Web_server"title="Web server">web servers</a>, many <atarget="_blank"href="http://en.wikipedia.org/Operating_system"title="Operating system">operating systems</a> and <atarget="_blank"href="http://en.wikipedia.org/Platform_%28computing%29"class="mw-redirect"title="Platform (computing)">platforms</a>, and can be used with many <atarget="_blank"href="http://en.wikipedia.org/Relational_database_management_system"title="Relational database management system">relational database management systems</a>. 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.<supid="cite_ref-foundations_4-1"class="reference"><ahref="#cite_note-foundations-4"title="">[5]</a></sup></p>
<p>PHP primarily acts as a <atarget="_blank"href="http://en.wikipedia.org/Filter_%28software%29"title="Filter (software)">filter</a><supid="cite_ref-23"class="reference"><ahref="#cite_note-23"title="">[24]</a></sup>, taking input from a file or stream containing text and/or PHP instructions and outputs another stream of data; most commonly the output will be HTML. From PHP 4, the PHP <atarget="_blank"href="http://en.wikipedia.org/Parser"class="mw-redirect"title="Parser">parser</a><atarget="_blank"href="http://en.wikipedia.org/Compiler"title="Compiler">compiles</a> input to produce <atarget="_blank"href="http://en.wikipedia.org/Bytecode"title="Bytecode">bytecode</a> for processing by the <atarget="_blank"href="http://en.wikipedia.org/Zend_Engine"title="Zend Engine">Zend Engine</a>, giving improved performance over its <atarget="_blank"href="http://en.wikipedia.org/Interpreter_%28computing%29"title="Interpreter (computing)">interpreter</a> predecessor.<supid="cite_ref-24"class="reference"><ahref="#cite_note-24"title="">[25]</a></sup></p>
<p>Originally designed to create dynamic web pages, PHP's principal focus is <atarget="_blank"href="http://en.wikipedia.org/Server-side_scripting"title="Server-side scripting">server-side scripting</a><supid="cite_ref-25"class="reference"><ahref="#cite_note-25"title="">[26]</a></sup>, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a <atarget="_blank"href="http://en.wikipedia.org/Client_%28computing%29"title="Client (computing)">client</a>, such as <atarget="_blank"href="http://en.wikipedia.org/Microsoft"title="Microsoft">Microsoft</a>'s <atarget="_blank"href="http://en.wikipedia.org/ASP.NET"title="ASP.NET">ASP.NET</a> system, <atarget="_blank"href="http://en.wikipedia.org/Sun_Microsystems"title="Sun Microsystems">Sun Microsystems</a>' <atarget="_blank"href="http://en.wikipedia.org/JavaServer_Pages"title="JavaServer Pages">JavaServer Pages</a><supid="cite_ref-26"class="reference"><ahref="#cite_note-26"title="">[27]</a></sup>, and <atarget="_blank"href="http://en.wikipedia.org/Mod_perl"title="Mod perl">mod_perl</a>. PHP has also attracted the development of many <atarget="_blank"href="http://en.wikipedia.org/Software_framework"title="Software framework">frameworks</a> that provide building blocks and a design structure to promote <atarget="_blank"href="http://en.wikipedia.org/Rapid_application_development"title="Rapid application development">rapid application development</a> (RAD). Some of these include <atarget="_blank"href="http://en.wikipedia.org/CakePHP"title="CakePHP">CakePHP</a>, <atarget="_blank"href="http://en.wikipedia.org/PRADO"title="PRADO">PRADO</a>, <atarget="_blank"href="http://en.wikipedia.org/Symfony"title="Symfony">Symfony</a> and <atarget="_blank"href="http://en.wikipedia.org/Zend_Framework"title="Zend Framework">Zend Framework</a>, offering features similar to other <atarget="_blank"href="http://en.wikipedia.org/List_of_web_application_frameworks"title="List of web application frameworks">web application frameworks</a>.</p>
<p>The <atarget="_blank"href="http://en.wikipedia.org/LAMP_%28software_bundle%29"title="LAMP (software bundle)">LAMP</a> architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the <i>P</i> in this bundle alongside <atarget="_blank"href="http://en.wikipedia.org/Linux"title="Linux">Linux</a>, <atarget="_blank"href="http://en.wikipedia.org/Apache_HTTP_Server"title="Apache HTTP Server">Apache</a> and <atarget="_blank"href="http://en.wikipedia.org/MySQL"title="MySQL">MySQL</a>, although the <i>P</i> can also refer to <atarget="_blank"href="http://en.wikipedia.org/Python_%28programming_language%29"title="Python (programming language)">Python</a> or <atarget="_blank"href="http://en.wikipedia.org/Perl"title="Perl">Perl</a>.</p>
<p>As of April 2007, over 20 million Internet domains were hosted on servers with PHP installed, and PHP was recorded as the most popular Apache module.<supid="cite_ref-usage_5-2"class="reference"><ahref="#cite_note-usage-5"title="">[6]</a></sup></p>
$output.=' '.t('Click the help icon to view the example help. Be sure to run cron to update the index if you want to try out the search features.');