php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23868 _SERVER["SERVER_PORT"] returns port 80 regardless...
Submitted: 2003-05-28 20:32 UTC Modified: 2003-05-28 20:58 UTC
From: excalibur at hub dot org Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.3.1 OS: FreeBSD 4.8-STABLE
Private report: No CVE-ID: None
 [2003-05-28 20:32 UTC] excalibur at hub dot org
Hi All, 

 Got an issue with PHP 4.3.1 that has driven me up one wall and down the other :> I managed to trace it back to the PHP global variables causing me the problem, here's what's happend:

 I have a number of webservers, some run on the default port 80, others on port 81 or more. But using this code:

 $test = $_SERVER['SERVER_PORT'];
 var_dump($test);

 prints out 80 each time, even if the apache server is natively running on port 81. 

 for instance, in the phpinfo output on a URL of:

 - http://webmail.test.com:81

  I get:

 _SERVER["SERVER_PORT"] | 80 

 as the result...

 I'm running a stock freebsd build of Apache 1.3.27 with modssl compiled in:

 - apache+mod_ssl-1.3.27+2.8.14

 a stock compile of PHP 4.3.1, with the config line of:

'./configure' '--with-apxs=/usr/local/sbin/apxs' '--with-config-file-path=/usr/local/etc' '--enable-versioning' '--with-regex=system' '--without-gd' '--without-mysql' '--with-zlib' '--with-bz2=/usr' '--with-mcrypt=/usr/local' '--with-imap=/usr/local' '--with-mysql=/usr/local' '--with-pgsql=/usr/local' '--with-ldap=/usr/local' '--with-expat-dir=/usr/local' '--with-dom=/usr/local' '--enable-ftp' '--with-gettext=/usr/local' '--with-pspell=/usr/local' '--enable-mbstring' '--with-mcal=/usr/local' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-trans-sid' '--prefix=/usr/local' 'i386-portbld-freebsd4.8'

 no other components are built in at this point, just a bare native compile on everthing and a very simple script:

 <?php
  $test = $_SERVER["SERVER_PORT"];
  var_dump($test);
 ?>

 please let me know if I can provide anything else..
 

 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-28 20:36 UTC] sniper@php.net
It's definately not bug in PHP. It's an Apache bug at best..
(the _SERVER is filled with data coming via Apache API)

 [2003-05-28 20:47 UTC] excalibur at hub dot org
Ok, so having the bug under the apache catagory should allow the apache team to pick up on it?
 [2003-05-28 20:58 UTC] sniper@php.net
No, I just reclassified if someone else hits the same.
You need to submit separate bug report at bugs.apache.org
but do read this first:

http://httpd.apache.org/docs/mod/core.html#usecanonicalname

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 12:01:32 2024 UTC