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
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:
MUST BE VALID
Solve the problem:
45 - 2 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 15:01:30 2024 UTC