After installing PHP on Ubuntu, you naturally need to configure it to your needs. For the basics, see the discussion on PHP configuration on Ubuntu. On this page, we start to look at Ubuntu's default php.ini in-depth.
PHP's initialisation file is far too long for a single page discussion. Therefore, the main sections of the default php.ini file are listed below with descriptions of what each one addresses. You can see each in context on our sample php.ini page. There are many sections that can be left empty when you are setting up a basic LAMP server. Similarly, some sections that would be used with a LAMP server will be left blank if you are using, for example, a PostgreSQL or Oracle database instead of MySQL.
- [PHP] This is the main PHP configuration section and configures precisely how the interpreter will behave in general terms.
- [Date] This configures how the Date module behaves.
- [filter] PHP filtering is configured in this section.
- [iconv] This section handles how character conversion will be done.
- [intl] The locale settings under which scripts will be run is set here.
- [sqlite] Any interaction with sqlite is handled here, but sqlite3 is handled below.
- [sqlite3] PHP's interface with sqlite3 is addressed in this section.
- [Pcre] The PCRE module allows PHP to use Perl-like regular expression handling.
- [Pdo] This section addresses how PHP should handle ODBC connections.
- [Pdo_mysql] If the mysqlnd module is used, this section indicates how to interact with it.
- [Phar] Where the Pdo section configures PHP's behavior with certain databases, Phar configures PHP to work with different types of archive files.
- [Syslog] Addresses how and when PHP should use the system log.
- [mail function] PHP's mail settings are contained here.
- [SQL] Configuration of PHP's use of SQL is addressed here.
- [ODBC] Further direction on using ODBC is located in this section.
- [Interbase] If you use an Interbase database system, you can configure the interpreter's use of it in this section.
- [MySQL] PHP's interface with MySQL can be configured here.
- [MySQLi] If you use MySQL 4.1 or above, you can configure how PHP interacts with it from this section.
- [mysqlnd] This section configures the use of the MySQL native driver for PHP.
- [OCI8] This section configures the use of Oracle's databases 11g, 10g, 9i and 8i.
- [PostgresSQL] Configuration for us of the PostgreSQL DBMS is found here.
- [Sybase-CT] Behavior when accessing Sybase systems is found here.
- [bcmath] The bcmath module allows you to perform precise calculations and is configured here.
- [browscap] This module is used in detecting browser capabilities.
- [Session] The way PHP handles user session data is configured here.
- [MSSQL] Interaction with Microsoft's SQL Server is found here.
- [Assertion] An assertion runs a test on a value. This section configures how that is done.
- [COM] When using a COM-based framework, PHP behaves according to these directives.
- [mbstring] This configures how characters are represented internally.
- [gd] Handles interaction with the JPEG encoder.
- [exif] The exif library allows you to handle the metadata of image files and is configured here.
- [Tidy] The tidy module allows you to clean and powerfully manipulate HTML documents.
- [soap] Use of the SOAP protocol is handled here. If you use a WSDL file, you will probably want to configure some behavior in this section.
- [sysvshm] This configures the shared memory segment that the interpreter is able to use.
- [ldap] Use of the LDAP protocol is configured here.
- [mcrypt] The mcrypt module is used in several forms of cryptography and is configured here.
- [dba] This section is explicitly for configuring interaction with Berkeley DB databases.