summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-11-09 16:27:43 +0000
committerJani Taskinen <jani@php.net>2007-11-09 16:27:43 +0000
commit02d966c2634b3ac8b227db078bbee0b26876fed4 (patch)
treec64798a9f4f3f48008d7d3926327210f78898eb3 /sapi/cgi/cgi_main.c
parentc5776e1a411b1ea8748c390febfe077dced2ba9a (diff)
downloadphp-git-02d966c2634b3ac8b227db078bbee0b26876fed4.tar.gz
MFH:- Added support for [HOST=www.example.com] special sections
MFH:- Allowed using full path to load modules using "extension" directive
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 7c7fe0f897..98c61a4519 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -702,7 +702,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, int start
static int sapi_cgi_activate(TSRMLS_D)
{
- char *path, *doc_root;
+ char *path, *doc_root, *server_name;
uint path_len, doc_root_len;
/* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */
@@ -711,9 +711,10 @@ static int sapi_cgi_activate(TSRMLS_D)
}
doc_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1 TSRMLS_CC);
+ server_name = sapi_cgibin_getenv("SERVER_NAME", sizeof("SERVER_NAME") - 1 TSRMLS_CC);
- /* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
- if (!doc_root) {
+ /* DOCUMENT_ROOT and SERVER_NAME should also be defined at this stage..but better check it anyway */
+ if (!doc_root || !server_name) {
return FAILURE;
}
doc_root_len = strlen(doc_root);
@@ -736,6 +737,9 @@ static int sapi_cgi_activate(TSRMLS_D)
/* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */
php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */
+ /* Activate per-host-system-configuration defined in php.ini and stored into configuration_hash during startup */
+ php_ini_activate_per_host_config(server_name, strlen(server_name) + 1 TSRMLS_CC);
+
/* Load and activate user ini files in path starting from DOCUMENT_ROOT */
if (strlen(PG(user_ini_filename))) {
php_cgi_ini_activate_user_config(path, path_len, doc_root_len - 1 TSRMLS_CC);