I need to add a variable to the $_SERVER array in a php script. Is there a possibility to do this via the php.ini file? I want to add the variable for all scripts on the webserver, so it's quite inconvenient to add it in each script.
Thanks, TSS
I need to add a variable to the $_SERVER array in a php script. Is there a possibility to do this via the php.ini file? I want to add the variable for all scripts on the webserver, so it's quite inconvenient to add it in each script.
Thanks, TSS
If you're using Apache, try the SetEnv module.
(you can see more here: Declaring global variable with php.ini)
I can't think of a way to add things to $_SERVER via php.ini (which doesn't mean there's no way to do it).
However, you could add things to $_ENV, server-wide, using SetEnv in httpd.conf (assuming apache, here). There are likely methods for doing this with other web servers, but I'm not sure what they are.