Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP-WIN] Settings per virtual site on IIS ?

0 views
Skip to first unread message

Shane Caraveo

unread,
Dec 31, 2001, 1:27:49 PM12/31/01
to php-w...@lists.php.net
Yes, you can use the registry to do per-directory settings.

HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values

Create keys for each directory, then add the entries. So if you're
website is at c:\inetpub\wwwroot, under the above key, add:

HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\

Then add the ini entries.


Olivier Mascia wrote:
>
> Hello,
>
> Is there some mechanism with PHP 4.1 on Win32/IIS (ISAPI module)
> allowing to define some initialisation settings per website ?
>
> Something along the line of Apache php_value/php_flag instructions that
> can be set in its httpd.conf file within virtual-sites settings :
>
> php_value include_path ".:/usr/local/lib/php"
> php_flag safe_mode on
>
> Or possibility to have the ISAPI module load an additional php.ini local
> to the site in addition to the global one in %SYSTEM% ?
>
> phpinfo() lists "local" settings and "global" settings.
> Are those necessarily the same with PHP ISAPI on IIS ?
>
> Thanks for any answer or suggestions,
> --
> Olivier Mascia <o...@mascia.biz>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows...@lists.php.net
> For additional commands, e-mail: php-wind...@lists.php.net
> To contact the list administrators, e-mail: php-lis...@lists.php.net

Christoph Grottolo

unread,
Jan 1, 2002, 5:27:15 AM1/1/02
to php-w...@lists.php.net, php...@lists.php.net
How about mentioning this in the manual? Would be helpful.

Happy new year to all

Christoph

"Shane Caraveo" <sh...@caraveo.com> schrieb im Newsbeitrag
news:3C30AE25...@caraveo.com...

Olivier Mascia

unread,
Jan 1, 2002, 4:30:32 AM1/1/02
to php-w...@lists.php.net
Hello,

Shane Caraveo wrote:

SC> Yes, you can use the registry to do per-directory settings.
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
SC>
SC> Create keys for each directory, then add the entries. So if you're
SC> website is at c:\inetpub\wwwroot, under the above key, add:
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\
SC>
SC> Then add the ini entries.

Great ! But where is this document ?
I could not find any info before your post.
Thank you very much !

--
Olivier Mascia <o...@mascia.biz>

Olivier Mascia

unread,
Jan 2, 2002, 6:02:04 AM1/2/02
to Shane Caraveo, php-w...@lists.php.net
Hello,

Shane Caraveo wrote:

SC> Yes, you can use the registry to do per-directory settings.
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
SC>
SC> Create keys for each directory, then add the entries. So if you're
SC> website is at c:\inetpub\wwwroot, under the above key, add:
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\
SC>
SC> Then add the ini entries.

It doesn't work well (or completely for me).
If I override 'include_path' (restart IIS) I can see the new local
setting reflected with phpinfo(). Great.
But if also override 'open_basedir' and 'upload_tmp_dir', both these
values keep their default global setting of 'no value' (there is indeed
no values set for these in PHP.INI).

Are there known bugs with this system ? Or could there be some
mis-understanding of how it works on my side ?

I defined three values in the key leaf corresponding to the root of the
website I wanted to test against :

include_path REG_SZ {the physical path of my website}
open_basedir REG_SZ {the same}
upload_tmp_dir REG_SZ {the same}

And obviously only the include_path is taken into account.
I do not know if it is only the first setting which is taken into
account or if there is something un-understood by me regarding the other
two, but it looks buggy.

Thanks in advance for any hint or suggestion !

--
Olivier Mascia <o...@mascia.biz>

Christoph Grottolo

unread,
Jan 2, 2002, 10:30:45 AM1/2/02
to php-w...@lists.php.net

"Olivier Mascia" <o...@mascia.biz> schrieb im Newsbeitrag
news:20020102123...@mascia.biz...
| Hello,
|
| Olivier Mascia wrote:
|
| OM> SC> Yes, you can use the registry to do per-directory settings.
| OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
| OM> SC> Create keys for each directory, then add the entries. So if
you're
| OM> SC> website is at c:\inetpub\wwwroot, under the above key, add:
| OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory
Values\c\inetpub\wwwroot\
| OM> SC> Then add the ini entries.
| OM>
| OM> It doesn't work well (or completely for me).
| OM> If I override 'include_path' (restart IIS) I can see the new local
| OM> setting reflected with phpinfo(). Great.
| OM> But if also override 'open_basedir' and 'upload_tmp_dir', both these
| OM> values keep their default global setting of 'no value' (there is
indeed
| OM> no values set for these in PHP.INI).
| OM>
| OM> Are there known bugs with this system ? Or could there be some
| OM> mis-understanding of how it works on my side ?
| OM>
| OM> I defined three values in the key leaf corresponding to the root of
the
| OM> website I wanted to test against :
| OM>
| OM> include_path REG_SZ {the physical path of my website}
| OM> open_basedir REG_SZ {the same}
| OM> upload_tmp_dir REG_SZ {the same}
| OM>
| OM> And obviously only the include_path is taken into account.
| OM> I do not know if it is only the first setting which is taken into
| OM> account or if there is something un-understood by me regarding the
other
| OM> two, but it looks buggy.
| OM>
| OM> Thanks in advance for any hint or suggestion !
|
| There must be something wrong on my way of thinking.
| I checked the PHP source code and it looks like the loop to iterate over
| the values in the registry is correct. Indeed I have another value which
| I can change the local value without difficulties : 'sendmail_from'.
| That is correctly reflected as locally changed (as well as 'include_path')
| by phpinfo(). Though 'open_basedir' and 'upload_tmp_path' are still not
| taken into account.
|

I'm pretty shure you can't change open_basedir and upload_tmp_path values
because of security issues. I think the IIS-per directory settings are
parsed like the values in the .htaccess file with apache.
So if the user could change the'open_basedir' value, he would be able to
access any file on the server with php by just putting

open_basedir="/";

into .htaccess (think of an ISP environment). I think I've read an article
about that somewhere, but I can't remember where, sorry.

Christoph


Olivier Mascia

unread,
Jan 2, 2002, 6:34:45 AM1/2/02
to php-w...@lists.php.net
Hello,

Olivier Mascia wrote:

OM> SC> Yes, you can use the registry to do per-directory settings.
OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
OM> SC> Create keys for each directory, then add the entries. So if you're
OM> SC> website is at c:\inetpub\wwwroot, under the above key, add:
OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\
OM> SC> Then add the ini entries.
OM>
OM> It doesn't work well (or completely for me).
OM> If I override 'include_path' (restart IIS) I can see the new local
OM> setting reflected with phpinfo(). Great.
OM> But if also override 'open_basedir' and 'upload_tmp_dir', both these
OM> values keep their default global setting of 'no value' (there is indeed
OM> no values set for these in PHP.INI).
OM>
OM> Are there known bugs with this system ? Or could there be some
OM> mis-understanding of how it works on my side ?
OM>
OM> I defined three values in the key leaf corresponding to the root of the


OM> website I wanted to test against :
OM>
OM> include_path REG_SZ {the physical path of my website}
OM> open_basedir REG_SZ {the same}
OM> upload_tmp_dir REG_SZ {the same}
OM>

OM> And obviously only the include_path is taken into account.
OM> I do not know if it is only the first setting which is taken into
OM> account or if there is something un-understood by me regarding the other


OM> two, but it looks buggy.
OM>
OM> Thanks in advance for any hint or suggestion !

There must be something wrong on my way of thinking.
I checked the PHP source code and it looks like the loop to iterate over
the values in the registry is correct. Indeed I have another value which
I can change the local value without difficulties : 'sendmail_from'.
That is correctly reflected as locally changed (as well as 'include_path')
by phpinfo(). Though 'open_basedir' and 'upload_tmp_path' are still not
taken into account.

I'm a little bit lost in conjectures World !
:-)

--
Olivier Mascia <o...@mascia.biz>

0 new messages