How to find out which php.ini file PHP is using?
To find out which php.ini file (and its full file path) just run the following command:
Which will output something like this:
$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none)
If you need to check from within a PHP script, you can either put this code in (if it isn't public facing) and search for 'Loaded configuration file':
<?php phpinfo(); ?>
<?php var_dump(php_ini_loaded_file()); ?>