PHP configuration

PHP is a web template system that accidentally grew up into a fairly general language. PHP's syntax, capabilities, and execution model bear vague similarities to Perl; scripts are loaded by an "interpreter", compiled to bytecode, and then executed. The PHP interpreter can be run from the command line, CGI-style, or more commonly as an in-process Apache module.

Installation
Please see http://www.php.net/manual/en/installation.php.

Compile-time options
MediaWiki either needs or wants a number of optional features of PHP that need to be enabled at compile time:
 * mbstring multibyte character string support (optional; slower custom code will be used if not available)
 * iconv character set conversion library (optional; other conversion functions will be used if not available)
 * zlib compression library, optionally to compress the file cache
 * sockets support for network communication, if using memcached

PHP is a computer scripting language originally designed for producing dynamic web pages. It is for server-side scripting, but can be used from a command line interface or in standalone graphical applications.

While 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. Released under the PHP License, the Free Software Foundation considers it to be free software.

PHP is a widely used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on more than 20 million websites and 1 million web servers.It is also the most popular Apache module among computers using Apache as a web server.The most recent major release of PHP was version 5.2.6 on May 1, 2008.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 ASP.NET system, 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, PRADO, Symfony 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 and Wikipedia (Mediawiki).

We are successfully working with these compiler options:

'./configure' \ '--with-mysql' \ '--without-sqlite' \ '--with-apxs2=/usr/sbin/apxs2' \ '--with-zlib' \ '--with-ldap' \ '--with-gd' \ '--with-jpeg-dir' \ '--with-iconv-dir' \ '--enable-mbstring'

In detail, these configure options do the following:


 * --with-mysql : Allows PHP to query MySQL. This is an essential feature (I think). You will need to have MySQL installed to enable this option.
 * --without-sqlite : This simply trims down the build by removing an unnecessary component of PHP. This is not essential, but it should make the build less likely to fail due to missing dependencies and should result in a smaller PHP install.
 * --with-apxs2=/usr/sbin/apxs2 : this is required if you want to build mod_php. APXS is for configuring compilation of an Apache module. You will need to change (or omit the path) for your specific system.
 * --with-zlib : Allows PHP to read / write zipped files and send compressed data to Apache ... or something like that
 * --with-ldap : Important if you want your wiki users to be verified by LDAP
 * --with-gd : Use this if you want image processing 'within' PHP, else you can use ImageMagick. Because this option requires that you have various libraries installed... but presumably IM has the same deps... oh well...
 * --with-jpeg-dir : Seems nonsensical
 * --with-iconv-dir : Seems nonsensical
 * --enable-mbstring : Allows multibyte character string support. This is optional, as slower custom code will be used if not available.

Opcode caching
If running a high-traffic site, it is highly recommended that a system be used to cache the compiled scripts; there are a number of such plugins for PHP, some free, some proprietary. There is a list of some caches:
 * Alternative PHP Cache
 * Turck MMcache
 * ionCube PHP Accelerator

Fortunately, these all seem to be easy to install as Zend plugins, you just drop in a library and change your php.ini. No fussy recompiling of the entire PHP!

Depending on the cache and options used, you may have to perform a special operation whenever updating script files.

MediaWiki can also interact with that caches and use them for object caching, see Manual:$wgMainCacheType.

Image Resizing
ImageMagick can be used for image resizing (see Manual:Configuration settings). When it is not available the GD PHP module is used instead where found.