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.
- A simple
php -i|grep 'Loaded Configuration File'
returns the systemphp.ini
. find /home/ -xdev -name php.ini 2>/dev/null
returns allphp.ini
belonging to all hosted domains.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?