php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33728 Allow to include files in php.ini
Submitted: 2005-07-16 20:35 UTC Modified: 2006-01-04 21:30 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: phpbugs at thequod dot de Assigned:
Status: Open Package: Feature/Change Request
PHP Version: 5.0.4 OS:
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-07-16 20:35 UTC] phpbugs at thequod dot de
Description:
------------
It would be very helpful in a CGI (or FastCGI) setup to have an include directive for php.ini that includes a file where the directive occurs.

This way you could have a central php.ini for all virtual hosts and include this in each virtual host's php.ini.

I know that with mod_php you can put most of the directives into Apache's VirtualHost directives, but with mod_fastcgi/mod_cgi this is not possible.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-04 02:46 UTC] sniper@php.net
There's already this which can be used to accomplish pretty much same thing:

  --with-config-file-scan-dir=PATH
                          Set the path where to scan for                                                                                            
                          configuration files

 [2006-01-04 21:30 UTC] phpbugs at thequod dot de
I don't see what it would help in the situation where you  
want to have a common main php.ini for all vhosts or  
subgroups thereof and just override some values on a  
per-host basis..  
 
--with-config-file-scan-dir would be a static path, 
wouldn't it? 
 
The only solution I could imagine to use 
--with-config-file-scan-dir=\$CONF_PHP so that $CONF_DIR 
could be set in the fastcgi starter/wrapper script. But I 
don't think that it's supposed to work like that. 
 
As it seems, what I'll have to do is write a script that 
scans for files like php_override.ini in the vhost 
directories and merges them into a single php.ini file.
 [2006-06-24 16:05 UTC] dennis at 28studios dot com
I second this feature request.  I am doing a FastCGI install of PHP and have exactly this need.  

I have multiple virtual hosts, each of which may need specific php.ini parameters set, but I would like to have a global php.ini file that I include from the vhost specific one.

A temporary work around I am looking at is recompiling PHP with my gloabl options set as the defaults, although I do not know yet if this is possible, and it is highly undesirable as changes in the global options require a recompile.
 [2011-04-14 23:37 UTC] butesa at freenet dot de
There seems to be a patch: http://tekrat.com/php/php-ini-includes/
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC