I search the path where the php.ini file is located in our Linux Ubuntu server, and I found many php.ini files when executing the command find / -name php.ini. So how can I know exactly from a PHP script web page where the php.ini is located?
I search the path where the php.ini file is located in our Linux Ubuntu
Share
You can use php_ini_loaded_file().
Taken from php.net:
You may also want to check php_ini_scanned_files().
Also, you should note that if you run a PHP script from CLI, it’s possible that a different
php.inifile will be used than if a server (e.g., nginx or Apache) runs it.Other options:
php -i|grep 'php.ini'info.phpthat contains<?php phpinfo();in the webroot, and run it in your browser