|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21739 remote port number not sent in host header
Submitted: 2003-01-18 21:15 UTC Modified: 2003-04-29 09:12 UTC
From: warren at konkel dot net Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.0 OS: linux
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: warren at konkel dot net
New email:
PHP Version: OS:


 [2003-01-18 21:15 UTC] warren at konkel dot net
I noticed that when giving WSDL the URL of a dynamically generated WSDL (such as Java's tomcat web services server), the server was returning a port number of 80 rather than 8080... I looked into and found out that the request sent to the server doesn't include the remote port... this fixed it:

on line 191 of HTTP/Request.php, currently there is: 
if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) {  
    $this->addHeader('Host', $this->_url->host); 

it SHOULD be: 

if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) {  
    if ($this->_url->port) {  
        $this->addHeader('Host', $this->_url->host . ":" . $this->_url->port);  
    } else {  
        $this->addHeader('Host', $this->_url->host);  



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-29 09:12 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 18:03:14 2021 UTC