From:             simon at bleif dot de
Operating system: Windows Server 2003 x64 R2 SP2
PHP version:      5.2.1
PHP Bug Type:     IIS related
Bug description:  "Per Directory Values" are not applied correctly

Description:
------------
According to
http://www.php-center.de/en-html-manual/configuration.changes.html, you are
able to change parts of the PHP-configuration on a per-directory-manner.
After setting the desired configuration options there and restarting IIS,
only the options for the first folder (if there are some "folders"/registry
keys within the same "folder"/key each configured with individual options)
are applied.
A trace with Regmon shows the W3WP enumerating and (successfully)
accessing all entries under the "Per Directory Values"-hive.

Reproduce code:
---------------
Setup at least 2 virtul hosts (located under C:\Inetpub\wwwroot\a and
C:\Inetpub\wwwroot\b).
Start Regedit, navigate to the key HKLM\Software\PHP
(HKLM\Software\Wow6432Node\PHP if you are on x64), create the subkey "Per
Directory Values". This key gets a new subkey named "c", that key gets one
named "Inetpub", that one gets a subkey named "wwwroot".
Now you create two keys (one named "a", the other one named "b") directly
below the key "wwwroot".
Now, create a new string value called for example "log_errors" in both of
these keys and set that value to the opposite of the value defined in the
php.ini (for example 0).
Restart IIS, place a file named test.php in both physical virtual host
directory containing the following:
<?php
echo 'log_errors = ' . ini_get('log_errors');
echo 'log_errors2 = ' . get_cfg_var('log_errors');
?>

If you now launch your web browser, point it to virtual host A, the
correct values (as they were set in the registry) are being displayed.
If you do the same with host B, the default values (as set in the php.ini
or a registry key above the virtual host B configuration-key) (or NULL) are
beeing displayed, not the setting defined in the registry.

If you now delete the key "a" in the registry and restart IIS, the correct
value is displayed when you point your browser to virtual host B. If you
create a third virtual host C (folder: c), the settings stored in the
registry are applied only if there are no other hosts-settings defined
before (in alphabetical order, starting with a) that host in the same
registry-key.

The same issue also appears on a second server (same OS, same versions,
but different php.ini).
The issue applies both in safe- and non-safe mode.

Expected result:
----------------
The settings are being applied correctly on a per folder-level.

Actual result:
--------------
The settings are only applied to the first (in alphabetical order)
configured folder in a directory. Further details please see under
"Reproduce code".

-- 
Edit bug report at http://bugs.php.net/?id=41233&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41233&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41233&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41233&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41233&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41233&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41233&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41233&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41233&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41233&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41233&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41233&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41233&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41233&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41233&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41233&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41233&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41233&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41233&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41233&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41233&r=mysqlcfg

Reply via email to