|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-11 19:00 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 12:00:01 2025 UTC |
Description: ------------ Based on the output, SERVER_NAME should output the ServerName value within the VirtualHost entry within the httpd.conf while instead it is outputing the current hostname which could be any of the ServerAlias entries. I have setup PHP 4.3.7 with: './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-zlib-dir=/usr' '--disable-all' '--with-regex=php' '--with-pear' '--enable-bcmath' '--enable-ctype' '--with-curl=/usr/local' '--with-db4=/usr/local' '--enable-dba' '--with-dom=/usr/local' '--with-dom-xslt=/usr/local' '--with-dom-exslt=/usr/local' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local' '--with-t1lib=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-xpm-dir=/usr/X11R6' '--with-iconv-dir=/usr/local' '--enable-mbstring' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-mime-magic=/usr/share/misc/magic.mime' '--with-mysql=/usr/local' '--with-openssl-dir=/usr/local' '--with-openssl=/usr/local' '--enable-overload' '--with-pcre-regex=yes' '--enable-posix' '--with-pgsql=/usr/local' '--with-pspell=/usr/local' '--enable-session' '--enable-sockets' '--enable-tokenizer' '--with-expat-dir=/usr/local' '--enable-xml' '--with-xmlrpc' '--enable-xslt' '--with-xslt-sablot=/usr/local' '--with-zlib=yes' '--with-apxs2=/usr/local/sbin/apxs' '--x-libraries=/usr/X11R6/lib' '--x-includes=/usr/X11R6/include' '--prefix=/usr/local' 'i386-portbld-freebsd4.8' nshb# uname -a FreeBSD nshb.inimit.ca 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu Apr 3 10:53:38 GMT 2003 root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC i386 <VirtualHost *> ServerAdmin webmaster@inimit.com DocumentRoot /domains/inimit.com/www/wwwroot ServerName inimit.com ServerAlias www.inimit.com ErrorLog /domains/inimit.com/www/logs/error.log CustomLog /domains/inimit.com/www/logs/access.log common </VirtualHost> Reproduce code: --------------- <?php echo $_SERVER["SERVER_NAME"]; echo $_SERVER["HTTP_HOST"]; ?> Expected result: ---------------- Result: (If on http://inimit.com) inimit.com inimit.com Result: (If on http://www.inimit.com) inimit.com www.inimit.com Actual result: -------------- Result: (If on http://inimit.com) inimit.com inimit.com Result: (If on http://www.inimit.com) www.inimit.com www.inimit.com