|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 - 24 = ?
Subscribe to this entry?

 [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: Wed Mar 22 23:04:45 2023 UTC