Re: memory_limit Setting?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Paulson wrote:
Hi everyone,

I¹m trying to upload a 25MB file via PHP and I¹m setting the memory limit
way high so I don¹t get a fatal error from php (the error is below).  What I
find really odd about this is that the error message says that PHP tried to
allocate almost 54MB.  First question is why is PHP allocating so much
memory when I¹m only uploading a 25MB file?
Question is what does your code look like? AFAIK, PHP uploads files to a temp directory where you can do whatever you want with them. If you don't read them into memory, it won't use a lot of memory (just the overhead required for the $_FILES array).
Second question is why is PHP
failing when obviously the memory limit is set to just over 100MB?
It's trying to allocate over 50M, but fails because existing memory usage + attempted memory usage is greater than 100M. Call memory_get_usage() right before the line on which it fails to see how much memory is being used by your script.

jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux