∟Additional .ini Configuration Files

This section describes additional .ini files separated from the main configuration file php.ini.

What Is additional .ini File? - An additional .ini file is PHP configuration file separated from the main configuration file php.ini.

An additional .ini file is usually created during the installation process of a PHP module. It contains configuration settings specific to the installed module. For example, after installing the "mbstring" module on my Ubuntu 18 computer, I get this additional .ini file:

herong$ more /etc/php/7.2/cli/conf.d/20-mbstring.ini 

; configuration for php mbstring module
; priority=20
extension=mbstring.so

You can also create your own additional .ini file to add or update configuration settings. For example, I created the following .ini file:

herong$ sudo vi /etc/php/7.2/cli/conf.d/99-my-own.ini

memory_limit = 1024M
mysqli.default_user = herong
mysqli.default_pw = TopSecret
...

By the way, if you want to know where additional .ini files should be placed, run the "php --ini" command. Here is an example on my Ubuntu computer:

herong$ php --ini 

Configuration File (php.ini) Path: /etc/php/7.2/cli
Loaded Configuration File:         /etc/php/7.2/cli/php.ini
Scan for additional .ini files in: /etc/php/7.2/cli/conf.d
Additional .ini files parsed:      /etc/php/7.2/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.2/cli/conf.d/10-opcache.ini,
/etc/php/7.2/cli/conf.d/10-pdo.ini,
/etc/php/7.2/cli/conf.d/20-calendar.ini,
/etc/php/7.2/cli/conf.d/20-ctype.ini,
...

Table of Contents

 About This Book

 Introduction and Installation of PHP

 Managing PHP Environment and Modules on macOS

 Managing PHP Environment and Modules on CentOS

►Configuration and Modules

 Manage Runtime Configuration Directives

 "php -i" - Display Configuration Information

 php.ini - Configuration Directive File

►Additional .ini Configuration Files

 Load PHP Extensions/Modules

 extension_dir - Module Library Location

 "php -m" - Display Loaded Modules

 get_extension_funcs() - Get Module Functions

 dl() - Load Module Dynamically

 cURL Module - Client for URL

 DOM Module - Parsing HTML Documents

 GD Module - Manipulating Images and Pictures

 MySQLi Module - Accessing MySQL Server

 OpenSSL Module - Cryptography and SSL/TLS Toolkit

 PCRE Module - Perl Compatible Regular Expressions

 SOAP Module - Creating and Calling Web Services

 SOAP Module - Server Functions and Examples

 Zip Module - Managing ZIP Archive Files

 References

 Index

 Full Version in PDF/EPUB