title: PHP Fatal error: Out of memory (allocated 1707606016) (tried to allocate 426680697 bytes)
body: <p>I have a droplet on DigitalOcean, it was a 10$ package with 1GB Memory, then I upgraded to 20$ package.</p>
  
  <p>So how it all started was that I'm trying to upload a file from one server to another using cURL parameters, now the issue is... The file doesn't send because I get this beautiful error.</p>
  
  <pre><code>PHP Fatal error:  Out of memory (allocated 1707606016) (tried to allocate 426680697 bytes)
  </code></pre>
  
  <p>Now I have <code>memory_limit</code> set to 2048MB because that's how much MB of memory I got on my VPS. Now before I upgraded, I had only 1024MB of memory and the error message was different at the time, and this is what I got.</p>
  
  <pre><code>PHP Fatal error:  Out of memory (allocated 530055168) (tried to allocate 529639729 bytes) 
  </code></pre>
  
  <p>My VPS has MORE than enough memory to upload a 403MB file, and I have my memory_limit maxed, there's no way I need to upgrade the servers memory limit.</p>
  
  <pre><code>memory_limit = 2048M
  file_uploads = On
  upload_max_filesize = 5000M
  max_file_uploads = 20
  allow_url_fopen = On
  post_max_size = 0
  max_execution_time = 90000
  max_input_time = 90000
  </code></pre>
  
  <p>Obviously it may look like a duplicate, but the solutions on all of the posts I've looked at <strong>don't</strong> work for me. The script that is having its memory_limit is literally a handler that handles the cURL request sent from the alternative server. </p>