title: PHP: Out of memory as soon as upload_max_filesize is set
body: <p>I am uploading and resizing images on my website and I got an </p>
  
  <blockquote>
    <p>Out of memory (allocated 89391104) (tried to allocate
    20736 bytes)</p>
  </blockquote>
  
  <p>error. So I set memory_limit = 700M in php.ini. It worked, I could upload the whole form, but the image was not uploaded. I checked the error, it was </p>
  
  <blockquote>
    <p>The uploaded file exceeds the upload_max_filesize directive in php.ini</p>
  </blockquote>
  
  <p>Than I added <code>upload_max_filesize = 50M</code> to php.ini and now I receive the "Out of memory" error again. 
  Any ideas why this could happen and how I can fix it? </p>