从命令行查找加载的php.ini

I am on a server with multiple domains. I would like to find out which php.ini gets loaded in each domain.
I've got a few different tools at hand. Perhaps they get me closer to what I want.

  1. A simple php -i|grep 'Loaded Configuration File' returns the system php.ini.
  2. find /home/ -xdev -name php.ini 2>/dev/null returns all php.ini belonging to all hosted domains.
  3. virtualmin list-php-directories --domain this.is.a.domain --multiline returns all directories in which a specific version of PHP has been activated.

Some sample output:
1. Returns:

Loaded Configuration File => /etc/php/7.0/cli/php.ini

This is obviously the php.ini which gets loaded by the host OS.
2. Returns:

...
/home/domain.x.com/etc/php5/php.ini
/home/domain.x.com/etc/php7.0/php.ini
/home/domain.x.com/etc/php.ini
/home/domain.y.com/etc/php7.0/php.ini
/home/domain.y.com/etc/php.ini
...

This is a complete list of all php.ini in those domains.
3. Returns:

/home/domain.x.com/public_html
  PHP version: 7.0
  Full version: 7.0.8
  Execution mode: fcgid
  Web root directory: Yes

There is always a php.ini in /home/domain.foo.com/etc/. Is that the one that hets loaded? Or do I have to check virtualmin for which version of PHP is loaded to traverse into the appropriate subdir? Is there a completely different way?

Note: I only have the command line at hand and only one user for monitoring purposes. Also, the process should be non-invasive. So I dont' think that I can put some php files in those domains to get my answer through a browser. Is the info perhaps stored in some file I can parse?

From only the command line, you would need to:

  1. Install a command line web browser OR you can use wget to hit the script and save the response in a file.
  2. Have a php file with <?php phpinfo(); in all of the domains
  3. Make sure that all the domains are able to be loaded on the webserver or the webserver has internet access to load the domains directly from web. Best would be to map all the domains to localhost in the hosts file.
  4. Open the phpinfo script from each domain in the command line browser and check the loaded configuration file OR if you have chosen to use wget, just save the output to file and inspect the contents of the file and you would get the loaded config file.