php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30623 Returns a wrong port info($_SERVER["SERVER_PORT"])
Submitted: 2004-10-30 19:18 UTC Modified: 2004-11-16 17:05 UTC
From: artemsd at rambler dot ru Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 4.3.9 OS: Windows 2000 sp4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: artemsd at rambler dot ru
New email:
PHP Version: OS:

 

 [2004-10-30 19:18 UTC] artemsd at rambler dot ru
Description:
------------
PHP is sure, that web-server listens 80 port, but it is wrong. 
This bug is only by PHP 4, by PHP 5 this is correct.

From phpinfo():
HTTP_HOST 	*.dyndns.org:81
----
SERVER_PORT  80

Reproduce code:
---------------
$serverPort = $_SERVER["SERVER_PORT"];//80, but must be 81

Expected result:
----------------
$serverPort = 81;

Actual result:
--------------
$serverPort = 80;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-30 19:35 UTC] artemsd at rambler dot ru
PHP 4.3.9 works as CGI
PHP 5.0.2 works as Apache module
Apache version is 2.0.50
 [2004-11-16 17:05 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is Apache issue.
Set UseCanonicalName to Off in your httpd.conf and it'll work as you're expecting.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun May 09 21:01:24 2021 UTC