[nycbug-talk] setting php.ini from httpd.conf

Charles Sprickman spork at bway.net
Tue Feb 27 00:55:08 EST 2007


Hi all,

I currently have the need to run a few instances of apache on one host. 
This is now very simple with the apache20 port in FreeBSD - the rc.d 
script allows you to start up multiple instances of apache like so:

apache2_enable="YES"
apache2_profiles="foo bar"
apache2ssl_foo_enable="YES"
apache2ssl_bar_enable="YES"
apache2_foo_configfile="/usr/local/etc/apache2/httpd-foo.conf"
apache2_bar_configfile="/usr/local/etc/apache2/httpd-bar.conf"

Works great.

However I want to run php in both and I want to have each read a different 
php.ini.  I've been googling my brains out on this, and digging through 
the php docs, but I'm not seeing a way to do this.  The php docs mention 
how you can set some php.ini values, but no info on telling it to load an 
entirely different php.ini:

http://us3.php.net/configuration.changes

Setting environment values in apache has no effect on this either unless 
you are running php as a cgi.  I saw some random posts about throwing a 
php.ini in the server and/or doc root, but that seems to do nothing (and 
both apache instances need the same doc root/server root anyhow).

I'm baffled, as this seems like something that would be pretty common, no?

Thanks,

Charles



More information about the talk mailing list