title: How to fix error "cURL Error #:transfer closed with outstanding read data remaining" on PHP
body: <p>I try curl on php and i have curl syntax on Lumen 5.*, but if data is big can't running</p>
  
  <pre><code>        $curl = curl_init();
          curl_setopt_array($curl, array(
              CURLOPT_URL =&gt; $url,
              CURLOPT_RETURNTRANSFER =&gt; true,
              CURLOPT_ENCODING =&gt; '',
              CURLOPT_MAXREDIRS =&gt; 10,
              CURLOPT_TIMEOUT =&gt; 60,
              CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST =&gt; 'GET',
              CURLOPT_HTTPHEADER =&gt; array(
                  'Cache-Control: no-cache',
                  'Content-Type: application/json',
                  'Authorization: Bearer blablabla' 
              ),
          ));
  
          $response = curl_exec($curl);
          $err = curl_error($curl);
  
          curl_close($curl);
  
          if ($err) {
              echo 'cURL Error #:' . $err;
          } else {
              if ($this-&gt;isJSON($response) == False) {
                  return $response;
              }
              return json_decode($response, true);
          }
  </code></pre>
  
  <p>but if data is big show error </p>
  
  <pre><code>cURL Error #:transfer closed with outstanding read data remaining
  </code></pre>
  
  <p>how to fix it?</p>