|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45914 ini_set() Does Not Work When Using Registry-Based "Per Directory Values"
Submitted: 2008-08-25 19:32 UTC Modified: 2017-10-24 07:27 UTC
Avg. Score:4.0 ± 1.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:4 (100.0%)
From: w dot ashcroft at redfoxuk dot com Assigned:
Status: Open Package: PHP options/info functions
PHP Version: 5.2CVS-2008-08-25 OS: win32 only
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: w dot ashcroft at redfoxuk dot com
New email:
PHP Version: OS:


 [2008-08-25 19:32 UTC] w dot ashcroft at redfoxuk dot com
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:

Reproduce code:
sendmail_from =

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

echo ini_get("sendmail_from") . "<br>";
ini_set("sendmail_from", "");
echo ini_get("sendmail_from");

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-25 23:09 UTC] w dot ashcroft at redfoxuk dot com
I can confirm the issue still exists in the current CVS snapshot.
 [2008-10-24 15:55 UTC]
Assigned to the Windows port maintainer.
 [2010-02-08 14:43 UTC] php at psdie dot com
This issue also means that we're unable to override the "error_log" value via ini_set() - it seems to work temporarily, then reverts to the default and can no longer be overridden. 

The simple test case is:

    ini_set('error_log', $_SERVER['DOCUMENT_ROOT'] .'\\_test.log'); 
    echo('log_errors='. ini_get('log_errors') ."

The above outputs the correct log filename initially, but then seems to stop working after a period of time (10 hours or so), then refuses to work from that point onward.

This bug was reported back in Aug 98 - is a fix or workaround available? I know that my host is unable to upgrade past v5.2.12 at present because of lack of Zend/ionCube Decoders support.

Many thanks,  Ben
 [2017-10-24 07:27 UTC]
-Status: Assigned +Status: Open -Assigned To: pajoye +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 19:01:29 2024 UTC