php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45114 Option to change --with-config-file-scan-dir runtime
Submitted: 2008-05-28 08:37 UTC Modified: 2011-01-23 21:16 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jani dot ollikainen at pronetko dot fi Assigned: jani
Status: Closed Package: PHP options/info functions
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID:
 [2008-05-28 08:37 UTC] jani dot ollikainen at pronetko dot fi
Description:
------------
There should be option to change it runtime.

Possible ways are:
- Command line parameter
- php.ini directive (there's many ways to change php.ini's location)
- Enviromental variable.
Pick your poison as long as there is a way.

Reason why this is needed is:
Think about situation that's default in most distros, extension loading is done with that setting. Then you want to make a CLI
program that makes a lot of fork() and you want keep it's memory footprint to be as low as possible. You cannot with acceptable way to change cli program not loading those extensions from scan dir.

Just edit the files in scan dir? They are needed for normal WWW php operation. Just make two different php.ini's that have the extensions? And that will break distros extension loading style. Just use the -n and put all the settings in file with ini_set() and dl() functions? Uhoh, Not nice.

And there seems to be patches around the net for this problem,
but nothing in PHP itself.
http://alt.linux.kiev.ua/srpm/php/patches/20
http://www.opendogs.org/pub/php-5_2_3-config-file-scan-dir.patch
http://pronetko.fi/~bestis/php-5.1.6-scandir.patch (my env version)



Expected result:
----------------
There should be a way to change it runtime.

Actual result:
--------------
No way to change it runtime. It can only be disabled with -n parameter but then there's no php.ini.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-12 20:04 UTC] jani@php.net
Quite closely related to bug #42604 which kinda requires such option/env/something to exist to be fixable.
 [2008-08-13 01:01 UTC] jani@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2008-08-13 01:03 UTC] jani@php.net
I added 2 ways to do this. Now you can either use both -n and -c in command line options (-n disables every ini loading, -c enables loading the specified file / from specified path) or set PHP_INI_SCAN_DIR environment variable to empty (disables scanning) or to point to some other directory.
 [2011-01-23 21:16 UTC] jani@php.net
-Package: Feature/Change Request +Package: PHP options/info functions
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 19:01:51 2014 UTC