#45914 [NEW]: ini_set() Does Not Work When Using Registry-Based "Per Directory Values"

[email protected] ("w dot ashcroft at redfoxuk dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             w dot ashcroft at redfoxuk dot com
Operating system: Windows Server 2003
PHP version:      5.2.6
PHP Bug Type:     *Configuration Issues
Bug description:  ini_set() Does Not Work When Using Registry-Based "Per Directory Values"

Description:
------------
It seems then when using Per Directory Values in the Windows Registry,
these values can then not be changed with ini_set() - for example we set
the sendmail_from value for each individual website using the
registry-based Per Directory Values, but the website owners should then be
able to set their own from address in their scripts using ini_set().

As I understand it, the in-script ini_set() should be the last possible
place a value can be changed (at runtime); not the registry.

Removing the registry entry gives the expected result of:

[email protected]
[email protected]

Reproduce code:
---------------
php.ini
sendmail_from = [email protected]

HKLM\SOFTWARE\PHP\Per Directory Values\[DirPath]
sendmail_from = [email protected]

<?php
echo ini_get("sendmail_from") . "<br>";
ini_set("sendmail_from", "[email protected]");
echo ini_get("sendmail_from");
?>

Expected result:
----------------
[email protected]
[email protected]

Actual result:
--------------
[email protected]
[email protected]

-- 
Edit bug report at http://bugs.php.net/?id=45914&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45914&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45914&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45914&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45914&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=45914&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45914&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45914&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45914&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45914&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45914&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=45914&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=45914&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45914&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45914&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45914&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45914&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45914&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45914&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45914&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45914&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.