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: 2015-01-08 23:42 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: *General Issues
PHP Version: * OS: *
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugs at thequod dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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/
 [2015-01-08 23:42 UTC] ajf@php.net
-Package: Feature/Change Request +Package: *General Issues -Operating System: +Operating System: * -PHP Version: 5.0.4 +PHP Version: *
 [2023-08-22 09:04 UTC] beertigerfive021 at gmail dot com
)thanks for the info.... (http://github.com)(https://www.paybyplatema.me/)
 [2024-04-02 13:50 UTC] paybyplatema8 at gmail dot com
thanks for the info.... (http://github.com)(https://paybyplatemas.online/)
 [2024-04-02 13:51 UTC] yojanagyaans at gmail dot com
thanks for the information.... (http://github.com)(https://paybyplatemas.online/login/)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 08:01:27 2024 UTC