sajad torkamani

List config files used by the PHP CLI

Run from the command-line:

php --ini

Example output:

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

List config files used by the web server process (e.g., PHP-FPM)

Call phpinfo() in a .php file that’s served on a web page and look for the following values:

List configuration files loaded by the PHP web server process.