Edit report at https://bugs.php.net/bug.php?id=65453&edit=1

 ID:                 65453
 Comment by:         sb at crawler-excavators dot com
 Reported by:        oli dot laurel at arcor dot de
 Summary:            Readfile() + mpg = http status 500, windows server
                     2008 r2 sp1, php 5.5.1
 Status:             Feedback
 Type:               Bug
 Package:            IIS related
 Operating System:   Windows Server 2008 R2 SP1
 PHP Version:        5.5.1
 Block user comment: N
 Private report:     N

 New Comment:

hello,
on 2 of our servers we have same behavior.
we could not narrow down exactly, why script returns error 500 but we also have 
iis + php readfile () in use.
hope you can reproduce & fix the bug soon,... if its really a bug.

regarding webserver crash with multiple downloads we can contribute following:
we have found a setting in iis. in fast-cgi settings, you can limit the "Rapid 
Fails perMinute" by default it is 10.
if you increase it, there will be no error 500 anymore shown to the users.
but in log you still get errors.
it seems that iis kills all php-cgi.exe processes if there are too many fails 
(error 500) in a specific time (perMinute).


Previous Comments:
------------------------------------------------------------------------
[2013-08-21 08:12:45] a...@php.net

I've just tried with apache and cli server and it's not reproduceable there 
even 
with a smaller bandwidth, so looks like it's stick to IIS. So no need you to do 
it. Still unclear if it's readfile() so going to test your way now.

------------------------------------------------------------------------
[2013-08-20 20:37:01] oli dot laurel at arcor dot de

you can reproduce webserver crash with multiple downloads by following steps:

create file with following content:
[c:\tmp\wget.cmd]
"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=20000 
--server-response http://127.0.0.1/index.php

open cmd and typ in 
cd c:\tmp
for /L %i in (0,1,10) do start wget.cmd %i

loop will start 10 cmd boxes and download the "movie.txt".
wait 10-20 seconds and interrupt download by closing all cmd windows (Close all 
windows)
wait 1-2 seconds and start again 10 multiple downloads 

open cmd typ in 
cd c:\tmp
for /L %i in (0,1,10) do start wget.cmd %i

now all request will be answered with Status 500

c:\tmp>"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=20000 --serve
r-response http://127.0.0.1/index.php
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-08-20 20:12:16--  http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...
  HTTP/1.1 500 Internal Server Error
  Cache-Control: private
  Content-Type: text/html; charset=utf-8
  Server: Microsoft-IIS/8.0
  Date: Tue, 20 Aug 2013 18:12:16 GMT
  Connection: keep-alive
  Content-Length: 5666
2013-08-20 20:12:16 FEHLER 500: Internal Server Error.



i will try it with apache & cli later because i'm not familiar with this "tools"

regards oli

------------------------------------------------------------------------
[2013-08-20 20:36:26] oli dot laurel at arcor dot de

hi,
sorry me too, overseen that you need --server-response option in wget.
good to see, that you can reproduce the behavior. :)
here is output of wget & description to reproduce the mutliple download crash:

---------- 8< 
--------------------------------------------------------------------------

C:\tmp>"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=20000 --serve
r-response http://127.0.0.1/index.php
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-08-20 19:51:18--  http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...
  HTTP/1.1 200 OK
  Cache-Control: no-cache
  Content-Length: 5702400
  Content-Type: text/plain
  Server: Microsoft-IIS/8.0
  X-Powered-By: PHP/5.5.2
  Content-Disposition: inline; filename="movie.txt"
  X-Pad: avoid browser bug
  Date: Tue, 20 Aug 2013 17:51:19 GMT
  Connection: keep-alive
Länge: 5702400 (5,4M) [text/plain]
In »index.php« speichern.

73% [===========================>           ] 4.193.792   --.-K/s   in 4m 14s

2013-08-20 19:55:34 (16,1 KB/s) - Lesefehler bei Byte 4193792/5702400 (Connectio
n reset by peer). Erneuter Versuch.

--2013-08-20 19:55:35--  (Versuch: 2)  http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...
  HTTP/1.1 200 OK
  Cache-Control: no-cache
  Content-Length: 5702400
  Content-Type: text/plain
  Server: Microsoft-IIS/8.0
  X-Powered-By: PHP/5.5.2
  Content-Disposition: inline; filename="movie.txt"
  X-Pad: avoid browser bug
  Date: Tue, 20 Aug 2013 17:55:35 GMT
  Connection: keep-alive
Länge: 5702400 (5,4M) [text/plain]
In »index.php« speichern.

12% [====>                                  ] 1.277.952   19,5K/s  eta 7m 11s


---------- >8 
--------------------------------------------------------------------------

------------------------------------------------------------------------
[2013-08-20 20:35:31] oli dot laurel at arcor dot de

test - please to not spam our bug system

------------------------------------------------------------------------
[2013-08-20 17:01:35] a...@php.net

That's not exactly what i wanted to see because you haven't used the 
--server-response option with wget. But now I 
see what I've overseen, consider this line in your wget output:

HTTP Anforderung gesendet, warte auf Antwort... 200 OK

I suppose that was something like "HTTP/1.1 200 OK" in the headers. 

Also in your last post to see - that are not multiple downloads at the same, 
but restarts on connection reset. The 
status 500 in the logs indicates merely this, not the headers sent out. That's 
what i get with curl and bandwith of 
20K, were probably the same with wget and this bandwidth

$ curl -v --limit-rate 20k  -o /dev/null http://127.0.0.1/65453/index.php
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...   % Total    % Received % Xferd  Average Speed   Time   
 Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
0connected
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET /65453/index.php HTTP/1.1
> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r 
> zlib/1.2.3
> Host: 127.0.0.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Content-Length: 6291456
< Content-Type: text/plain
< Server: Microsoft-IIS/8.0
< X-Powered-By: PHP/5.5.2-dev
< Content-Disposition: inline; filename="movie.txt"
< X-Pad: avoid browser bug
< Date: Tue, 20 Aug 2013 16:16:05 GMT
<
{ [data not shown]
 66 6144k   66 4095k    0     0  13525      0  0:07:45  0:05:10  0:02:35     0* 
Recv failure: Connection was reset
 66 6144k   66 4095k    0     0  13521      0  0:07:45  0:05:10  0:02:35     0* 
Closing connection #0

curl: (56) Recv failure: Connection was reset

Just where curl exits, wget retries the download until it's worked, so infinite 
tries by default. Testing with a 
static file works. Anyway no crash yet, but now it's to figure out why the 
connectio nreset happens. It could help 
if you could test the same with apache or cli, too.

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


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

    https://bugs.php.net/bug.php?id=65453


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

Reply via email to