Note that there are some explanatory texts on larger screens.

plurals
  1. POPhp upload strange behavior
    primarykey
    data
    text
    <p>I was testing a little application I've made and I saw a strange behaviour when uploading multiple files that exceed some size.</p> <p>I've read <a href="https://bugs.php.net/bug.php?id=13029" rel="nofollow">the bug</a> mentioned here, but its way long ago. Strangely, I experience the same behaviour as the guy mentions in the bug. </p> <ol> <li>When I upload, say 10 files in small size (50-300kb each) there is nothing wrong and the application works.</li> <li>When I upload, two files with 1.5mb each, the application outputs an error message as the maximum allowed size is 512kb by the application (2mb in php.ini).</li> <li>When I upload, multiple files that exceed 7 or 8 mb (I haven't tried to locate the exact size), php crashes without giving an error. Since I am in a development server, the errors are turned on and normally it displays the fatal errors. </li> <li>When I upload, 1 file (say 25mbs), I still have the same error.</li> </ol> <p>Well, I say it crashes because when I try to <code>var_dump($_FILES)</code> or even <code>var_dump($_POST)</code> the array returns null although it should have at least the submit name or whatever.</p> <p>I've checked the tmp folder and the files are not being stored there as well. However, another strange behavior is that when I upload the files that exceed this mysterious limit, the browser seems to be uploading (I see the page takes a while to load), however, as mentioned, php acts like it does not know anything.</p> <p>What could be the reasong of this strange behaviour?</p> <p>PS: I'm working on my localhost (wampserver) on Windows 7 64-bit.</p> <p><strong>EDIT</strong></p> <p>Found the solution:</p> <p>changing post_max_size from 8mb to something else solved my problem.</p> <p>Here is a quote from <a href="http://www.php.net/manual/en/ini.core.php#ini.post-max-size" rel="nofollow">the manual</a> for those who need:</p> <blockquote> <p>Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. , and then checking if $_GET['processed'] is set.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload