php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60606 Add a `set_ini_file()` function to load user configuration file.
Submitted: 2011-12-25 13:21 UTC Modified: 2015-04-07 19:21 UTC
Votes:14
Avg. Score:3.8 ± 1.6
Reproduced:8 of 11 (72.7%)
Same Version:4 (50.0%)
Same OS:1 (12.5%)
From: contact at omeid dot me Assigned:
Status: Wont fix Package: PHP options/info functions
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: contact at omeid dot me
New email:
PHP Version: OS:

 

 [2011-12-25 13:21 UTC] contact at omeid dot me
Description:
------------
There is `set_ini()` that can be used to change value of a given configuration 
option and for CGI or Fast-CGI users .user.ini file can be used to override the 
desired configuration options. but there is nothing when you use PHP as a 
server module.

Please add a `set_ini_file($path_to_user_ini);` function.

Expected result:
----------------
Here is a bare minimum example code in PHP:

function ini_set_file($ini_file) {
	foreach(parse_ini_file($ini_file) as $option => $newvalue){
		ini_set($option, $newvalue);
	}
}

 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-07 19:21 UTC] cmb@php.net
-Status: Open +Status: Wont fix
 [2015-04-07 19:21 UTC] cmb@php.net
That wouldn't make sense. Many ini settings can't be set from a
script for security reasons. So a set_ini_file() would either have
to ignore many settings, or it might open a back- door for
malicious code to change settings that shouldn't be changed.

Furthermore, there are most likely technical issues preventing some
ini settings to be changed in a running engine.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 11:01:25 2019 UTC