3 ms·
But a webserver does not know its external IP, that is the whole confusion. Don't PHP docs say: 'SERVER_NAME' The name of the server host under which the curre
by amalag 12y ago
But a webserver does not know its external IP, that is the whole confusion. Don't PHP docs say:
'SERVER_NAME' The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.
'HTTP_HOST' Contents of the Host: header from the current request, if there is one.
- psaintla 12y ago1.) You're assuming that the script was running on a vhost, we don't know. 2.) Even if the script is running in a vhost, if a listening port is specified but not an IP address the SERVER_NAME will be the IP of whatever the interface the http connection came from was.