[PHP] programatically determining path to php.ini ?
I have not been able to find any way of determining the path to the current php.ini file, programatically, from within a running script. The only hack I can think of is to parse the ouput of phpinfo(). Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] programatically determining path to php.ini ?
I have not been able to find any way of determining the path to the current php.ini file, programatically, from within a running script. The only hack I can think of is to parse the ouput of phpinfo(). Any ideas? http://us3.php.net/manual/en/function.get-cfg-var.php get_cfg_var('cfg_file_path'); -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] programatically determining path to php.ini ?
On 6/29/05, gk [EMAIL PROTECTED] wrote: I have not been able to find any way of determining the path to the current php.ini file, programatically, from within a running script. The only hack I can think of is to parse the ouput of phpinfo(). php -r 'system( php -i|grep ini );' Configuration File (php.ini) Path = /etc/php.ini -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] programatically determining path to php.ini ?
I think this is a better solution than parsing phpinfo() output: realpath( get_cfg_var ( cfg_file_path )); - Greg On Wed, 29 Jun 2005 10:51:27 -0700, Greg Donald [EMAIL PROTECTED] wrote: On 6/29/05, gk [EMAIL PROTECTED] wrote: I have not been able to find any way of determining the path to the current php.ini file, programatically, from within a running script. The only hack I can think of is to parse the ouput of phpinfo(). php -r 'system( php -i|grep ini );' Configuration File (php.ini) Path = /etc/php.ini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php