summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r--sapi/apache/mod_php5.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 74707ce7f2..d7672fd338 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -352,6 +352,10 @@ static struct stat *php_apache_get_stat(TSRMLS_D)
*/
static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
{
+ if (SG(server_context) == NULL) {
+ return NULL;
+ }
+
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
/* }}} */