You can check which php.ini
file is the used one looking at the output of phpinfo()
.
See the image at this blog post, there's a row saying Loaded Configuration file
. That's the value you are looking for.
From the command line, you can use:
php -i | grep 'Loaded Configuration File'
From inside php, there's the php_ini_loaded_file
function