I'm tring to upload an 8mb file (the very smallest of the files I'll have) and I'm getting...
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2048 bytes) in /var/www/photos/admin/thumbnail.php on line 8
Code: Select all
if(!($src_img = imagecreatefromjpeg($image))) return "e;Error in imagecreatefromjpeg({$image})"e;;Code: Select all
if (!mkdir($uppath.$dir)) err("e;Unable to create directory '{$dir}'. Alread uploaded?"e;);
else {
//...
if (!move_uploaded_file($_FILESї'userfile']ї'tmp_name'], $upfile)) err('Unable to move uploaded file.');
//...
exec("e;tar xfz {$basefile} 2>/var/www/photos/uhoh"e;);
//...
require '../../admin/thumbnail.php';
if (($handle = opendir('.')) !== false) {
for ($n=0; false !== ($file = readdir($handle)); $n++) {
if (preg_match('/.+?\.jpg$/',$file)) {
chmod($file,0644);
$res = thumb($dir,$file);
if ($res !== true) err('Unable to create thumbnail: '.$res);
}
}
}
//...So anyway, how can I fix this bugger?
Edit: O.O Ok.. I know you won't believe this.. It appeared again. As in it's there now. I promise it wasn't there before!!! I ran a script that read all the dirs (that matched a type) and afterwards it was there!! o.o
Ok. Whatever.
SO:
Edit: oh bugger. I just realized I tar'd the wrong damn files. XD No wonder!! It was trying to use an image that was... *looks* ..well, 669kb, but 2048x1536px. Hahaha. I marvel at my own stupidity sometimes.Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2048 bytes) in /var/www/photos/admin/thumbnail.php on line 8