Bug #45914 [Asn->Opn]: ini_set() Does Not Work When Using Registry-Based "Per Directory Values"
Edit report at https://bugs.php.net/bug.php?id=45914&edit=1
ID: 45914
Updated by: kalle@php.net
Reported by: w dot ashcroft at redfoxuk dot com
Summary: ini_set() Does Not Work When Using Registry-Based
"Per Directory Values"
-Status: Assigned
+Status: Open
Type: Bug
Package: PHP options/info functions
Operating System: win32 only
PHP Version: 5.2CVS-2008-08-25
-Assigned To: pajoye
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2010-02-08 14:43:10] 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
------------------------------------------------------------------------
[2008-10-24 15:55:12] jani@php.net
Assigned to the Windows port maintainer.
------------------------------------------------------------------------
[2008-08-25 23:09:00] w dot ashcroft at redfoxuk dot com
I can confirm the issue still exists in the current CVS snapshot.
------------------------------------------------------------------------
[2008-08-25 20:40:09] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2008-08-25 19:32:02] w dot ashcroft at redfoxuk dot com
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:
notset@notset.com
webmaster@example.com
Reproduce code:
---------------
php.ini
sendmail_from = notset@notset.com
HKLM\SOFTWARE\PHP\Per Directory Values\[DirPath]
sendmail_from = noreply@example.com
<?php
echo ini_get("sendmail_from") . "<br>";
ini_set("sendmail_from", "webmaster@example.com");
echo ini_get("sendmail_from");
?>
Expected result:
----------------
noreply@example.com
webmaster@example.com
Actual result:
--------------
noreply@example.com
noreply@example.com
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=45914&edit=1
Thread (6 messages)