ID:               22937
 Updated by:       [EMAIL PROTECTED]
 Reported By:      freddie at bingham dot net
-Status:           Feedback
+Status:           Bogus
 Bug Type:         HTTP related
 Operating System: Redhat 7.3
 PHP Version:      4.3.2
 Assigned To:      wez
 New Comment:

The HTTP protocol specifies User-Agent as an optional header, it also
states that invalid requests should be replied to with an appropriate
error message (a response code between 400 and 599).

The webserver at pub133.ezboard.com conforms to neither of those
requirements.

PHP only sends the User-Agent header if one is provided via the php.ini
option 'user_agent' (or, as of PHP 5.0.0, via one of the apropriate
context options).  In this case the webserver in question is throwing
out the request as invalid and providing no error data, both of which
are improper behavior.

With agreement from wez I'm marking this bug bogus because PHP is
behaving as it should, the webserver is not.

Suggested workaround to user:  Specify a user_agent in php.ini or via
ini_set().


Previous Comments:
------------------------------------------------------------------------

[2003-06-10 16:54:58] [EMAIL PROTECTED]

Wow - this works for me, both with 4.3.2 and the same 4.3.3-dev from
yesterday.

I don't have the slightest idea why this works, though. 

------------------------------------------------------------------------

[2003-06-10 16:13:15] [EMAIL PROTECTED]

Try the following test:

<?php
  ini_set('user_agent', 'PHP/4.3.2');

  $p = fopen('http://pub133.ezboard.com/bonesixthwarriors', 'rb');
  $p2 = fopen('http://www.microsoft.com', 'rb');

?>


------------------------------------------------------------------------

[2003-06-10 14:43:06] [EMAIL PROTECTED]

According to
<http://www.ezboard.com/corporate/pressroom/inthenews_enterpriselinux.html>,
this "SmallWebServer" is their own software, written in SmallTalk.
Google finds only pages inside the ezboard.com domain, so they are
probably the only ones using it.

------------------------------------------------------------------------

[2003-06-09 16:12:38] [EMAIL PROTECTED]

It looks like the web server at that address doesn't like the request
headers coming in multiple packets.

Performing a strace on php shows that it is conforming to the HTTP
protocol, but the remote host does not send a response (recv call
returns 0).

To me, this sounds like a bug in the web server (I've never heard of
SmallWebServer; anyone have any info on it?).

I'm working on a write buffer for streams that will act as a workaround
for this problem, but my time is limited, so please be patient.

------------------------------------------------------------------------

[2003-06-09 16:01:07] [EMAIL PROTECTED]

I'm afraid I can verify this one, both with 4.3.2 and 4.3.3-dev as of
today:

# sapi/cli/php -c php.ini-recommended -r '
$p = fopen("http://pub133.ezboard.com/bonesixthwarriors";, "rb");
var_dump($http_response_headers);
'
PHP Warning:  fopen(http://pub133.ezboard.com/bonesixthwarriors):
failed to open stream: HTTP request failed! à|ïc ÿÿÿÿÿÿÿÿ in Command
line code on line 2
PHP Notice:  Undefined variable:  http_response_headers in Command line
code on line 3
NULL
# 

Configured only with --enable-debug --disable-mbstring, it's the same
problem, but slightly different junk characters in the error message.
Otherwise these junk characters are always the same (for the same
build).

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22937

-- 
Edit this bug report at http://bugs.php.net/?id=22937&edit=1

Reply via email to