Re: IIS 6 + PHP / multiple php.ini files
From: Paul Lynch (paul.lynch_at_nospam.com)
Date: 07/20/04
- Next message: Andrey P: "Re: Adding FTP connection without setting credentials"
- Previous message: Mark Easton: "New Style***.css not served to clients"
- In reply to: Steffen Nielsen: "IIS 6 + PHP / multiple php.ini files"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Jul 2004 23:45:00 +0100
On Tue, 20 Jul 2004 13:45:01 -0700, Steffen Nielsen <Steffen
Nielsen@discussions.microsoft.com> wrote:
>Altough you can alter different settings in the php.ini file by using the PHP ini_set function, some settings can only be set in the php.ini file itself.
>
>I'm looking for a way to run multiple websites on the same webserver, but at the same time having each website use it's own php.ini file in contrast to using one global php.ini file.
>
>Does anybody know a way to accomplish that in IIS6?
Steffen,
I'm certainly no PHP expert but I think this may actually be possible.
I've been doing some testing and troubleshooting of PHP scripts on
IIS6 and one thing I've discovered is that PHP searches for the
php.ini file in a number of locations and in a specific sequence.
I've got a basic install of PHP 4.3.8 on IIS6 and its installed into
the C:\PHP directory. I've got a web site called 'Test' which is
located at D:\test and in that directory is a simple 'Hello World'
type file called Index.php. OK so far ?
What I've noticed is that PHP looks for an ini file in this order :
D:\test\php-cgi-fcgi.ini
C:\PHP\php-cgi-fcgi.ini
C:\Windows\php-cgi-fcgi.ini
D:\test\php.ini
C:\php.ini
C:\Windows\PHP.ini
So what I did is copy php.ini to the D:\test directory and then rename
the file in C:\Windows to php.ini.bak to see what would happen.
In my case, once the php.ini file is located in D:\test it is
processed and PHP looks no further for any other instances of the
file. At least this is what I *think* is happening, you would perhaps
want to carry out a more thorough test than I have done.
But as far as I can ascertain PHP stops looking once it has found an
acceptable php.ini file to process. So it would appear that running
multiple instances as such may indeed be possible.
Regards,
Paul Lynch
MCSE
- Next message: Andrey P: "Re: Adding FTP connection without setting credentials"
- Previous message: Mark Easton: "New Style***.css not served to clients"
- In reply to: Steffen Nielsen: "IIS 6 + PHP / multiple php.ini files"
- Messages sorted by: [ date ] [ thread ]