Where to find ServerName in a PHP Script

Posted by Josh K on Server Fault See other posts from Server Fault or by Josh K
Published on 2010-05-01T02:31:41Z Indexed on 2010/05/01 2:38 UTC
Read the original article Hit count: 326

I'm looking to retrieve the ServerName field located in /etc/apache2/apache2.conf. My only issue is then calling it in PHP (echo $_SERVER['SERVER_NAME'];) it gives me not the server name but the ip address.

If I pull a phpinfo(); I can the server name under the Hostname:Port field under the apache2handler, so I know it's accessible somehow.

© Server Fault or respective owner

Related posts about php

Related posts about apache2