Posted by comp.lang.php on 09/25/06 20:41
I have an image that's only 100K in size, and I am working with 8mb of
memory. If I do this:
[PHP]
print_r(ceil((int)ini_get('memory_limit') * 10 *
filesize(actual_path("$locationPath/$this->fileName")) / 1000000) .
'M'); // PRINTS OUT "2M" for 2mb
]/PHP]
The image itself requires far less than the maximum amount of memory
required.
However, the moment I do this:
[PHP]
$imagestring =
@file_get_contents(actual_path(realpath("$locationPath/" .
$this->{$section . '_name'})));
[/PHP]
It locks up and forces a download of "index.php" (which indicates to me
that the memory allotment of 8mb has been used up).
How in the world can a 100KB image that uses only 2mb of 8mb use up 8mb
of memory on file_get_contents() alone? I'm completely confused!
Thanx
Phil
[Back to original message]
|