[PHP] PHP refuses to look in the areas I tell it to for its php.ini file, why?

2005-01-25 Thread v0id null
Here is my setup
Windows 2000 with latest service packs

One apache 1.3 install, but two services running off it with two
different configuration files. One file is for PHP4 and one is for
PHP5, and that works like a charm. Oh, both PHP's are running as SAPI
modules for Apache, not as CGI. I'm using both the LoadModule and
AddModule directives.

PHP4 is in c:/php and PHP5 is in c:/php5.

The issue? Neither PHP's seem to be able to find php.ini and for some
really stupid reason, neither of the PHPs seem to really care. I don't
even know how PHP is running without its php.ini file, especially
since its able to load extensions even though, according to phpinfo,
it's trying to find extensions in directories that don't even exist!

I've added both php's directories into my PATH enviroment variable in
windows, I've added SetEnv PHPRC C:/php in httpd.php4.conf (obviously
the apache conf file for php4) and that does nothing for PHP4. I
haven't tried anything for PHP5 because on the immediate side of
things, its not important.

PHP4 is looking for php.ini in c:\WINNT, and its not there. There is
nothing of PHP's files inside any windows directory, no dlls, no ini
files, nothing. Everything is contained in PHP's own directory, which,
so it seems, is reading it partially.

From httpd.php4.conf - here are the config items directly related to
php, in the order in which they apear:

LoadModule php4_module C:/php/php4apache.dll
AddModule mod_php4.c
SetEnv PHPRC C:/php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The Apache PHP4 config works perfectly, php is able to run, but like I
said, phpinfo shows nothing. Now while I can't show the output of
phpinfo directly off the server, http://www.psikon.info./phpinfo.html
is a copy. This is of course the PHP4 apache service outputting this.

Any help anyone could offer would be GREATLY appreciated,
Thanks
-- 
llundi0v

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP refuses to look in the areas I tell it to for its php.ini file, why?

2005-01-25 Thread Richard Lynch
v0id null wrote:
 The issue? Neither PHP's seem to be able to find php.ini and for some
 really stupid reason, neither of the PHPs seem to really care. I don't
 even know how PHP is running without its php.ini file, especially

If PHP can't find a php.ini file, it uses the defaults set up when it was
compiled, and the same values as if it had found the default php.ini file
that comes with the distribution.

 since its able to load extensions even though, according to phpinfo,
 it's trying to find extensions in directories that don't even exist!

The extensions it is finding or not finding in the directories that do or
don't exist are pre-set by compiled-in default-values-for-no-php.ini
values.

Windows being windows, DLLs that live next to php.exe (or the php4ts.dll
or whatever the hell it is) may be automagically found by the Windows
OS...  At least, that's how I've understood Windows to work...  Actually,
with the DLL setup, I guess it would find any DLLs sitting in the same
directory as apache.exe...

You could drive yourself crazy trying to figure out which software
(PHP/Apache/OS) is looking for what where.

 I've added both php's directories into my PATH enviroment variable in
 windows, I've added SetEnv PHPRC C:/php in httpd.php4.conf (obviously
 the apache conf file for php4) and that does nothing for PHP4. I
 haven't tried anything for PHP5 because on the immediate side of
 things, its not important.

Don't know nothin' bout no SetEnv PHPRC...  Is that documented in the
manual?...

 PHP4 is looking for php.ini in c:\WINNT, and its not there. There is

So put one there, and life will be good.

The setting for C:\WINNT is compiled into the PHP binary (.exe or .dll)
and that's pretty much where you need to put php.ini if you want it to
work...

Though if you get that SetEnv thing working, and it's a documented
feature, more power to you.

 nothing of PHP's files inside any windows directory, no dlls, no ini
 files, nothing. Everything is contained in PHP's own directory, which,
 so it seems, is reading it partially.

Again, that might be Windoze finding the DLLs more than PHP -- There is
a whole set of rules for Windoze and DLL loading and whatnot that I've
long purged from my brain.  I think it's even documented somewhere on
Microsoft's site...  Good Luck!

 Any help anyone could offer would be GREATLY appreciated,

With any luck at all, your php5 install is looking for php.ini in a
different directory...

Use phpinfo() to determine where it thinks the file should be.

PS:  phpinfo() will output something 'odd' when there is no php.ini file
to be found as opposed to when it found one in the directory where it
looks.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php