PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/upload_2G.phpt ('file upload greater than 2G')

Script

1: <?php
2:
3:
echo "Test\n";
4:
5: include 
"php_cli_server.inc";
6:
7:
php_cli_server_start("var_dump(\$_FILES);"false,
8:     
"-d post_max_size=3G -d upload_max_filesize=3G");
9:
10: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
11:
$port intval($port)?:80;
12:
$length 2150000000;
13:
$output "";
14:
15:
$fp fsockopen($host$port$errno$errstr0.5);
16: if (!
$fp) {
17:   die(
"connect failed");
18: }
19:
20:
$prev "----123
21: Content-Type: text/plain; charset=UTF-8
22: Content-Disposition: form-data; name=\"file1\"; filename=\"file1.txt\"\n\n"
;
23:
$post "\n----123--\n";
24:
$total $length strlen($prev) + strlen($post);
25:
26:
fwrite($fp, <<<EOF
27:
POST /index.php HTTP/1.1
28: Host: 
{$host}
29: Content-Type: multipart/form-data; boundary=--123
30: Content-Length: 
{$total}
31:
32:
{$prev}
33:
EOF
34: ) or die(
"write prev failed");
35:
36:
$data str_repeat("0123456789"10000);
37: for (
$i 0$i $length$i += 10000 10) {
38:     
fwrite($fp$data) or die("write failed @ ($i)");
39: }
40:
41:
fwrite($fp$post) or die("write post failed");
42:
43: while (!
feof($fp)) {
44:     
$output .= fgets($fp);
45: }
46: echo 
$output;
47:
fclose($fp);
48:
?>
49:
Done
50:

Expected

Test

HTTP/1.1 200 OK
Host: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8

array(1) {
  ["file1"]=>
  array(5) {
    ["name"]=>
    string(9) "file1.txt"
    ["type"]=>
    string(10) "text/plain"
    ["tmp_name"]=>
    string(%d) "%s"
    ["error"]=>
    int(0)
    ["size"]=>
    int(2150000000)
  }
}
Done

Output

Test


Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_6/sapi/cli/tests/upload_2G.php on line 15
connect failed

Diff

003- HTTP/1.1 200 OK
004- Host: %s
005- Connection: close
006- X-Powered-By: PHP/%s
007- Content-type: text/html; charset=UTF-8
004+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_6/sapi/cli/tests/upload_2G.php on line 15
005+ connect failed
009- array(1) {
010-   ["file1"]=>
011-   array(5) {
012-     ["name"]=>
013-     string(9) "file1.txt"
014-     ["type"]=>
015-     string(10) "text/plain"
016-     ["tmp_name"]=>
017-     string(%d) "%s"
018-     ["error"]=>
019-     int(0)
020-     ["size"]=>
021-     int(2150000000)
022-   }
023- }
024- Done

 

Generated at Thu, 20 Nov 2014 12:38:44 +0000 (23 hours ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.