I am getting the same error in my apache error log as described in this question. The only difference is that I am using $_SERVER as described in the answer.
Line 8 is:
The manual implies this index may not always be set http://php.net/manual/en/reserved.variables.server.php
Contents of the Host: header from the current request, if there is one.