|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2023 The PHP Group
All rights reserved.
Last updated: Sat Apr 01 08:03:37 2023 UTC