Use Environment variables instead of Server variables.

Because command-line PHP doesn't expose the $_SERVER variable.