Fixes #740 - Use getenv() instead of $_SERVER