What would cause a php script to just stop without reason?
<p>I'm using <a href="http://www.verot.net/php_class_upload.htm" rel="nofollow">class.upload.php</a> 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:</p>

<pre><code>// save uploaded image with a new name
$foo-&gt;file_new_name_body = $image_name;
$foo-&gt;Process($save_directory);

if ($foo-&gt;processed) {
echo 'original image copied 1';
} else {
echo 'error 1: ' . $foo-&gt;error;
}

echo '1';    $foo-&gt;file_new_name_body = $image_name . '_medium';


echo '2';    $foo-&gt;image_resize = true;


echo '3';    $foo-&gt;image_convert = jpg;


echo '4';    $foo-&gt;image_x = 300;


echo '5';    $foo-&gt;image_ratio_y = true;


echo '6';    $foo-&gt;file_overwrite = true;


echo '7';    $foo-&gt;Process($save_directory);


echo '8';

if ($foo-&gt;processed) {
echo 'original image copied';
} else {
echo 'error 2: ' . $foo-&gt;error;
}
</code></pre>

<p>Output:</p>

<pre><code>original image copied 1
1
2
3
4
5
6
7
</code></pre>

<p>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?</p>

<p>What would be causing this kind of behaviour?</p>

<p><strong>Edit</strong>
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.</p>

<p>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?</p>
