I’m using class.upload.php to upload images to a page. It seems a script that previously worked is now basically stopping part way through without any errors. At each line in the script, I’m echoing a number so I can get an idea at which point it stops, ie:
// save uploaded image with a new name
$foo->file_new_name_body = $image_name;
$foo->Process($save_directory);
if ($foo->processed) {
echo 'original image copied 1';
} else {
echo 'error 1: ' . $foo->error;
}
echo '1'; $foo->file_new_name_body = $image_name . '_medium';
echo '2'; $foo->image_resize = true;
echo '3'; $foo->image_convert = jpg;
echo '4'; $foo->image_x = 300;
echo '5'; $foo->image_ratio_y = true;
echo '6'; $foo->file_overwrite = true;
echo '7'; $foo->Process($save_directory);
echo '8';
if ($foo->processed) {
echo 'original image copied';
} else {
echo 'error 2: ' . $foo->error;
}
Output:
original image copied 1
1
2
3
4
5
6
7
I have no way to explain it. No errors. No feedback. No further code after echo ‘7’; is executed. What is going on? How can I debug?
What would be causing this kind of behaviour?
Edit
I was able to fix the issue simply by changing the file being uploaded. It was 2000px wide and when I saved it as a smaller 800px image it completed the process.
I changed the memory as suggested to 40m, however this still doesn’t let me process a 2000px wide image which doesn’t really make much sense to me. How much memory is needed to deal with files these sizes?
Check your memory limit, I find that if I hit that, PHP can (does?) just quit without saying anything.