|  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.
Block user comment
Status: Assign to:
Bug Type:
From: artemsd at rambler dot ru
New email:
PHP Version: OS:


 [2004-10-30 19:18 UTC] artemsd at rambler dot ru
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():

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

Expected result:
$serverPort = 81;

Actual result:
$serverPort = 80;


Add a Patch

Pull Requests

Add a Pull Request


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]
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 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-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 09:01:29 2024 UTC