|  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: 2021-03-28 04:22 UTC
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: cmb (profile)
Status: No Feedback Package: PHP options/info functions
PHP Version: 5.3.10 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
32 - 4 = ?
Subscribe to this entry?

 [2012-03-20 13:56 UTC] brad at njoe dot com
If ini_set() is called to set any PHP directive whose 'Changeable' attribute (e.g. 
as per man page 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:

ini_set('allow_url_fopen', '1');

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


Add a Patch

Pull Requests

Add a Pull Request


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() 

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 
 [2021-03-16 14:54 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-16 14:54 UTC]
ini_set() returns false if the directive could not be changed[1];
isn't checking the return value sufficient?

[1] <>
 [2021-03-28 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 12:01:25 2023 UTC