Edit report at https://bugs.php.net/bug.php?id=65453&edit=1
ID: 65453
Comment by: oli dot laurel at arcor dot de
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:
thx for reply to all. glad to hear i'm not alone (-:
tested different constellations in the last days.
but didnt find any working constellation.
tried to increase timeout settings in iis but no success.
maybe you figured out something new?
Previous Comments:
------------------------------------------------------------------------
[2013-08-23 14:06:05] [email protected]
>From what i could debug now, there is no crash in PHP itself. What happens is
>that PHP
exits early but IIS continues to deliver data to client. What I can assume now
is that
PHP fills the IIS buffers and waits for taker, but IIS doesn't ask anymore
because the
client is downloading with the very low bandwidth and the IIS buffer emties too
slowly.
Therefore two possibilities should be checked with IIS
- increasing timeout between PHP and IIS
- increasing internal IIS buffers, so then PHP can fill it up before it's full
Maybe it had really sense to check with IIS specialists anyway. What i'm
additionally
going to do now is to check if the same happens on linux with say
nginx+fastcgi,
because if it does - that were sure PHP issue.
------------------------------------------------------------------------
[2013-08-22 16:41:20] sb at crawler-excavators dot com
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).
------------------------------------------------------------------------
[2013-08-21 08:12:45] [email protected]
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
--------------------------------------------------------------------------
------------------------------------------------------------------------
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