title: PHP: out of memory error, what to do?
body: <p>I am receiving this error when Im trying to crop a image, I just uploaded. The image i just uploaded is around 3MB.</p>
  
  <p>Here's the error</p>
  
  <pre><code>&lt;br /&gt;
  &lt;b&gt;Fatal error&lt;/b&gt;:  Out of memory (allocated 45088768) (tried to allocate 15552 bytes) &lt;br /&gt;
  </code></pre>
  
  <p>And its happening when im trying to use this function: imagecreatefromjpeg($src);</p>
  
  <p>I have at top:</p>
  
  <pre><code>ini_set('memory_limit', '256M'); 
  </code></pre>
  
  <p>So how can it be out of memory, and how should i solve this? My limit for a image upload standard 6MB. (Although it uploads fine to the server, but when i use crop, I get error on the line with imagecreatefromjpeg() function, and "out of memory..")</p>