Table of content
Installing the PHP module for Apache, including support for IPv6. Additional extensions will be installed and configured.
- Requirement: Apache
- Reference: PHP documentation
Build information
Ensure the following options:
Configuration
The main configuration file is /usr/local/etc/php.ini
, it is also
possible to define most of the values in the Apache configuration
using directives: php_flag
, php_value
,
php_admin_flag
and php_admin_value
.
php.ini
- Interpreter
-
PHP will not use the short form (ie:
<?
) as it conflicts with processing instructions for XML documents. - Error handling
-
For a production system, errors and warnings will not be saved as they can be particularly numerous even if the code is functional.
- Memory
-
Limit memory usage to 20MB per web request.
- Files
-
Sending files is allowed, but limited to 2MB per file, the value of
post_max_size
is also involved in sending file because the transfer is done by thePOST
. - Timezone
-
For the correct operation of a number of applications, it is advisable to set the time zone. By default we choose
UTC
as it is the international basis of civil time adopted by most countries worldwide.
Apache
The main Apache configuration is located in the
/usr/local/etc/apache24/
directory, for PHP it is essentially made of
the module loading and the association of the PHP engine with *.php
and *.phps
files.
It can be decided to not create the Includes/php.conf
file.
In that case, it will only be required to add the corresponding line
in the website configuration, if it need to run PHP.
The line to be added being:
Apache
In case of PHP use, we wish to have the index file for directories to be processed by PHP. To achieve this we must specify the processing order of index files.
Thereafter special directives in PHP can be used to change the values
of various configuration elements, some will allow overloading using
the .htaccess
file, others do not. They are listed below:
Overloadable | Not overloadable | |
---|---|---|
Value | php_value |
php_admin_value |
Flag | php_flag |
php_admin_flag |
A configuration example, among others, is: