do not attempt to read host header if $_SERVER is not defined (eg in CLI execution)