This variable is highly dependent on the server configuration.
When using nginx with php5-fpm (fcgi), for example, you will pass the variable as fpm_parameter:
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
There is a similar configuration for scgi.
There are 3 types of global variables in $_SERVER , some of them are taken from the client request header and are not reliable, some of them are set by PHP / Webserver (for example, REMOTE_ADDR ) and are very reliable, and some depend on your configuration, which can be reliable in depending on this configuration.
DanFromGermany
source share