find your .ini

Posted by Dustin on June 11, 2008 under PHP, Web Development | 3 Comments to Read

find-your-ini

Sometimes I dabble in php a little so when I run onto something I wanna remember I like to tuck it away somewhere where I’ll remember where it is. This handy little snippet will tell you where your php.ini file is loading from. This is especially useful if you are using xampp/wampp/lampp since they tend to have multiple php.ini files and it’s anyones guess which one they are using (at least xampp does).

<?php
/*****CHECK TO SEE WHAT PHP.INI FILE IS LOADING*******/
$path = php_ini_loaded_file();
 
if ($path) {
    echo 'path to php.ini: ' . $path;
} else {
    echo 'A php.ini file is not loaded';
}
 
?>

Here’s a quick game, who can tell me how many times the word “where” was used in this post (including “somewhere”)?

  • Phil said,

    Awesome little script! Little things like this are always good to have on hand.

  • Phil said,

    Oh and to your game, if you count the entire post… I’m thinking 6.

  • Dustin said,

    Yes, Phil is the winner with a wild guess of 6.

Add A Comment