mechanism specific to the database vendor itself like mysql_real_escape_string() for MySQL.
PHP does not have complete native support for Unicode or multibyte strings; Unicode support
will be included in PHP 6. Many high profile open source projects ceased to support PHP 4 in
new code as of February 5, 2008, due to the GoPHP5 initiative, provided by a consortium of PHP
developers promoting the transition from PHP 4 to PHP 1397 It runs in both 32-bit and 64-bit
environments, but on Windows the only official distribution is 32-bit, requiring Windows 32-bit
compatibility mode to be enabled while using IIS in a 64-bit Windows environment. There is a
third-party distribution available for 64-bit Windows.
PHP is a general-purpose scripting language that is especially suited for web development. PHP
generally runs on a web server, taking PHP code as its input and creating web pages as output. It
can also be used for command-line scripting and client-side GUI applications. PHP can be
deployed on most web servers, many operating systems and platforms, and can be used with many
relational database management systems. 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 primarily acts as a filter, 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. It can
automatically detect the language of the user. From 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's principal focus is 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 Active Server Pages, 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.
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. Significant websites are written in
PHP including the user-facing portion of Facebook, Wikipedia , PHP can be used to create stand-
alone, compiled applications and libraries, it can be used for shell scripting, and the PHP binaries
can be called from the command line.
As with many scripting languages, PHP scripts are normally kept as human-readable source code,
even on production web servers. In this case, PHP scripts will be compiled at runtime by the PHP
engine, which increases their execution time. PHP scripts are able to be compiled before runtime
using PHP compilers as with other programming languages such as C (the language PHP and its
extensions are written in).
Code optimizers aim to reduce the computational complexity of the compiled code by reducing its
size and making other changes that can reduce the execution time with the overall goal of
improving performance. The nature of the PHP compiler is such that there are often opportunities
for code optimization, and an example of a code optimizer is the Zend Optimizer PHP extension.
Another approach for reducing overhead for high load PHP servers is using PHP accelerators.