Several of my administrators have grown to love PHPIniDir in the sapi/apache2handler/, so I've thrown together this patch for Apache 1.3 mod_php to provide the feature. I'm guessing alot of users would be grateful for it if they want to keep php.ini in the conf/ tree, or wherever makes the most sense for their system config.
Can be applied to mod_php4.c or mod_php5.c below; --- sapi/apache/mod_php4.c +++ sapi/apache/mod_php4.c @@ -814,6 +814,18 @@ } /* }}} */ +/* {{{ php_apache_phpini_set + */ +static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) +{ + if (apache_sapi_module.php_ini_path_override) { + return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; + } + apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); + return NULL; +} +/* }}} */ + /* {{{ int php_xbithack_handler(request_rec * r) */ static int php_xbithack_handler(request_rec * r) @@ -918,6 +930,7 @@ {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, + {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file (Admin)"}, {NULL} }; /* }}} */ --- sapi/apache/mod_php5.c +++ sapi/apache/mod_php5.c @@ -814,6 +814,18 @@ } /* }}} */ +/* {{{ php_apache_phpini_set + */ +static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) +{ + if (apache_sapi_module.php_ini_path_override) { + return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; + } + apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); + return NULL; +} +/* }}} */ + /* {{{ int php_xbithack_handler(request_rec * r) */ static int php_xbithack_handler(request_rec * r) @@ -918,6 +930,7 @@ {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, + {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file (Admin)"}, {NULL} }; /* }}} */ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php