In case it help someone, here is a function that makes it possible to inject server variables in a PHP script so it is available in the $_SERVER array.
The function looks like this :
static void inject_server_variable(request_rec *r, const char *name, const char *value)
{
apr_table_set(r->notes, name, value);
apr_table_set(r->subprocess_env, name, value);
}
The line :
apr_table_set(r->notes, name, value);
makes it possible to fetch the variable by using the apache_note function.
The line :
apr_table_set(r->subprocess_env, name, value);
stores the variable in the $_SERVER array so it can be fetched only by doing a simple print($_SERVER['xxxx'])












