find which php.ini is used
snippet in php

To find out where your php.ini is located

user7398

run: php --ini

find which php.ini is used

user2520

for cmd : php --ini
  
for code : use php_ini_loaded_file() as :=

$inipath = php_ini_loaded_file();
if ($inipath) {
    echo 'Loaded php.ini: ' . $inipath;
} else {
    echo 'A php.ini file is not loaded';
}