Re: Where does PHP look for php.ini??
| From: | Richard Lynch | Date: | Thu, 12 Jul 2007 00:07:34 +0000 |
| Subject: | Re: Where does PHP look for php.ini?? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258662@lists.php.net to get a copy of this message | ||
On Fri, July 6, 2007 7:53 pm, Stut wrote:
> Tijnema wrote:
>> I just noted that my php (CLI and Apache2 SAPI) doesn't read my
>> php.ini
>> in /etc
>> I have compiled php with --prefix=/usr, and my /usr/etc is symlinked
>> to /etc, but it doesn't read the php.ini file..
>> when I use the CLI with -c /etc it works fine :)
>
> php -i on the command line, or phpinfo() in a SAPI script will tell
> you
> where it expects to find it, as well as whether it did find it.
For the archives:
That's not quite 100% correct...
If you've set PhpIniDirectory in Apache2, for example, and php.ini
isn't in that directory, php will fall back onto looking for it in the
default compile-in location, and then it will tell you in phpinfo()
that it couldn't find php.ini in that compiled-in location, with no
mention that it looked in the PhpIniDirectory as well...
I spent about half an hour trying to figure out what was wrong with my
httpd.conf because of this...
Then threw php.ini into the directory and it worked just fine.
YMMV
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?