php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #61455 Warn when ini_set()'ing certain directives
Submitted: 2012-03-20 13:56 UTC Modified: 2012-03-20 14:01 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: brad at njoe dot com Assigned:
Status: Open Package: PHP options/info functions
PHP Version: 5.3.10 OS: N/A
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: brad at njoe dot com
New email:
PHP Version: OS:

 

 [2012-03-20 13:56 UTC] brad at njoe dot com
Description:
------------
If ini_set() is called to set any PHP directive whose 'Changeable' attribute (e.g. 
as per man page http://php.net/ini.list) is not 'PHP_INI_USER' or 'PHP_INI_ALL', 
an error message could be generated to advise the developer that the statement 
will have no effect. In other words, don't quietly allow directives to be changed 
when they've already taken effect by the time the script is executed (thus 
changing them via ini_set() won't ever do anything).

Test script:
---------------
<?php

ini_set('allow_url_fopen', '1');

Expected result:
----------------
Warning: Changing PHP directive at runtime has no effect in <code> on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-20 14:01 UTC] brad at njoe dot com
Errata #1 - Looks like PHP is intelligent enough to report the unchanged values 
for such directives when doing a phpinfo() (e.g. you can't ini_set() the 
'allow_url_fopen' directive and see the "Local Value" change on the phpinfo() 
page).

Thus, the "don't quietly allow directives to be changed" above should probably 
have been "don't quietly accept requests to change directives" or something of the 
sort.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 18:01:24 2019 UTC