|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49004 HTTP 1.1 streams painfully slow
Submitted: 2009-07-21 15:08 UTC Modified: 2010-05-19 16:34 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: andreas dot streichardt at globalpark dot com Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.*, 6CVS (2009-07-26) 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: andreas dot streichardt at globalpark dot com
New email:
PHP Version: OS:


 [2009-07-21 15:08 UTC] andreas dot streichardt at globalpark dot com
Whenever i try to fetch a file from my server using http 1.1 PHP takes multiple seconds to load the file. The server is fine. Firefox and curl load it at no time.

i noticed the same behaviour under PHP 5.2.10 (code a bit different as the stream_context_set_default is new. But the result is the same.

When i fetch a bigger file i see readfile() hanging somewhere at 90% of the file but i guess depends on the file ;)

Reproduce code:
$default_opts = array(

$default = stream_context_set_default($default_opts);

Expected result:
Time needed should be <0.01s

Actual result:
mop@minsk:~$ time curl http://minsk/~mop/x
LINE 0: 00000000000000000000000000000000000000000000000000000000000000000000000000000000

real    0m0.005s
user    0m0.004s
sys     0m0.000s

mop@minsk:~$ php x.php
LINE 0: 00000000000000000000000000000000000000000000000000000000000000000000000000000000

Size doesn't matter it seems. It always hangs!

Output of a manual session:

mop@minsk:~$ telnet localhost 80
Connected to localhost.
Escape character is '^]'.
GET /~mop/x HTTP/1.1
Host: minsk
Connection: close

HTTP/1.1 200 OK
Connection: close
Content-Type: application/octet-stream
Accept-Ranges: bytes
Content-Length: 89
Date: Tue, 21 Jul 2009 15:01:37 GMT
Server: lighttpd/1.4.19

LINE 0: 00000000000000000000000000000000000000000000000000000000000000000000000000000000
Connection closed by foreign host.

nothing fancy there :S


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-19 16:34 UTC]
-Status: Verified +Status: Bogus
 [2010-05-19 16:34 UTC]
Add "header" => array("Connection: close") to the context options.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC