Bug #65453 [Fbk]: Readfile() + mpg = http status 500, windows server 2008 r2 sp1, php 5.5.1
| From: | ab@php.net | Date: | Tue, 20 Aug 2013 17:01:35 +0000 |
| Subject: | Bug #65453 [Fbk]: Readfile() + mpg = http status 500, windows server 2008 r2 sp1, php 5.5.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181057@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65453&edit=1
ID: 65453
Updated by: ab@php.net
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:
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.
Previous Comments:
------------------------------------------------------------------------
[2013-08-20 15:31:24] oli dot laurel at arcor dot de
hi,
my other testsystem is windows 2012 with php 5.5.2 (x86). here is log and console output from today.
same setup as above & same problem.
when you cancle download of file by wget, did you get 200 or 500?
C:\tmp>"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=20000 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 15:21:09-- http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 5702400 (5,4M) [text/plain]
In »index.php.1« speichern.
52% [===================> ] 3.014.656 19,5K/s in 2m 31s
2013-08-20 15:23:40 (19,5 KB/s) - Lesefehler bei Byte 3014656/5702400 (Connectio
n reset by peer). Erneuter Versuch.
--2013-08-20 15:23:41-- (Versuch: 2) http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 5702400 (5,4M) [text/plain]
In »index.php.1« speichern.
48% [=================> ] 4.193.792 --.-K/s in 4m 14s
2013-08-20 15:27:56 (16,1 KB/s) - Lesefehler bei Byte 4193792/5702400 (Connectio
n reset by peer). Erneuter Versuch.
--2013-08-20 15:27:58-- (Versuch: 3) http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 5702400 (5,4M) [text/plain]
In »index.php.1« speichern.
42% [===============> ] 4.193.792 --.-K/s in 4m 14s
2013-08-20 15:32:13 (16,1 KB/s) - Lesefehler bei Byte 4193792/5702400 (Connectio
n reset by peer). Erneuter Versuch.
--2013-08-20 15:32:16-- (Versuch: 4) http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 5702400 (5,4M) [text/plain]
In »index.php.1« speichern.
1% [ ] 147.456 19,5K/s eta 8m 9s
------------------------------------------------------------------------
[2013-08-20 14:43:52] oli dot laurel at arcor dot de
Please try it with --limit-rate=20000:
"C:\Program Files\GnuWin32\bin\wget.exe" --limit-rate=20000 http://127.0.0.1
/index.php
[Console Output]
----------------
C:\>"C:\Program Files\GnuWin32\bin\wget.exe" --limit-rate=20000 http://127.0.0.1
/index.php
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2013-08-16 09:35:00-- http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 6702080 (6,4M) [text/plain]
In »index.php.7« speichern.
62% [=======================> ] 4.193.792 --.-K/s in 5m 33s
2013-08-16 09:40:35 (12,3 KB/s) - Lesefehler bei Byte 4193792/6702080 (Connectio
n reset by peer). Erneuter Versuch.
--2013-08-16 09:40:36-- (Versuch: 2) http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 6702080 (6,4M) [text/plain]
In »index.php.7« speichern.
1% [ ] 131.072 19,5K/s eta 8m 59s
------------------------------------------------------------------------
[2013-08-20 13:15:53] ab@php.net
CLI server also shows 200. It'd make sense to ask on IIS forums as well, as
nothing points to PHP yet.
------------------------------------------------------------------------
[2013-08-20 12:34:12] ab@php.net
I've just tried this with a text file of 6M with no reproduce.
Please post the output of these commands
wget --server-response --limit-rate=40000 http://127.0.0.1/65453/index.php
You can also try curl. It's available for windows or with msysgit shell
curl -v --limit-rate 40000 -o /dev/null http://127.0.0.1/65453/index.php
Thanks
------------------------------------------------------------------------
[2013-08-16 07:45:46] oli dot laurel at arcor dot de
hi,
thank you for reply.
- does the same happen when you out a plain text file instead of mpeg, also using appropriate
content-type and --limit-rate?
i changed content-type to text/plain and renamed movie.mpg to movie.txt. No behaviour change. If i
abort download i will also get a 500.
- does it happen when you request static content using wget with --limit-rate?
no, if i just download a file for example http://127.0.0.1/movie.mpg all works fine. Also if i abort
download.
Please use following configuration:
Description
------------
- Installed a blank Windows Server 2008 R2 SP1 Standard, added Role IIS & Feature CGI.
- Extracted 5.5.1 VC11 x86 Non Thread Safe to c:\Program Files (x86)\php
- Installed vcredist_x86.exe
- Configuration of IIS:
added Handler Mappings in IIS
Request path: *.php
Module: FastCgiModule
Executable: c:\Program Files (x86)\php\php-cgi.exe
Name: PHP via FastCgi
- Then added 2 files to C:\inetpub\wwwroot index.php & movie.mpg (6MB)
- add download.cmd to c:
- Installed wget.
- No modification of php.ini, no malware scanner, ...
- start c:\download.cmd
[download.cmd]
--------------
"C:\Program Files\GnuWin32\bin\wget.exe" --limit-rate=20000 http://127.0.0.1/index.php
[Console Output]
----------------
C:\>"C:\Program Files\GnuWin32\bin\wget.exe" --limit-rate=20000 http://127.0.0.1
/index.php
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2013-08-16 09:35:00-- http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 6702080 (6,4M) [text/plain]
In »index.php.7« speichern.
62% [=======================> ] 4.193.792 --.-K/s in 5m 33s
2013-08-16 09:40:35 (12,3 KB/s) - Lesefehler bei Byte 4193792/6702080 (Connectio
n reset by peer). Erneuter Versuch.
--2013-08-16 09:40:36-- (Versuch: 2) http://127.0.0.1/index.php
Verbindungsaufbau zu 127.0.0.1:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 6702080 (6,4M) [text/plain]
In »index.php.7« speichern.
1% [ ] 131.072 19,5K/s eta 8m 59s
[index.php]
-----------
<?php
$track = "movie.txt";
if (file_exists($track)) {
header("Content-Type: text/plain");
header('Content-Length: ' . filesize($track));
header('Content-Disposition: inline; filename="movie.txt"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($track);
exit;
} else {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
echo "no file";
}
?>
[movie.txt] 6MB (no change if its a real movie or not)
---------------
asdfghasdfghasdfgh...
[w3svc1.log]
------------
#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2013-08-16 07:38:26
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent)
sc-status sc-substatus sc-win32-status time-taken
2013-08-16 07:38:26 127.0.0.1 GET /index.php - 80 - 127.0.0.1 Wget/1.11.4 500 0 2147500037 205717
2013-08-16 07:41:04 127.0.0.1 GET /index.php - 80 - 127.0.0.1 Wget/1.11.4 500 0 64 28672
------------------------------------------------------------------------
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