title: PHP CURL NULL RESPONSE AFTER 10 SEC
body: <p>may i consult this to you.. So This is my settings for every curl request i made..</p>
  
  <pre><code> try{
      $ch = curl_init();
      if(strtoupper($method) == "POST" &amp;&amp; $setParamsforPOST == true){
          $body = json_encode($body);
          curl_setopt( $ch, CURLOPT_POSTFIELDS, $body );
      }
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      curl_setopt($ch, CURLOPT_URL, $curlUrl);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  
      curl_setopt($ch, CURLOPT_TIMEOUT, 60);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
     $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $data_curl = curl_exec($ch);
  
      curl_close($ch);
  
      return $data_curl;
   }catch(Exception $e){
      echo "An Error Has Encountered";
       header('X-PHP-Response-Code: 500', TRUE, '500');
      }
  </code></pre>
  
  <p>It works fine but in some scenarios it returns null response after 10 seconds.. But my timeout I set is actually 60 seconds as you see..</p>
  
  <p>Logger:</p>
  
  <p>//Works fine execution time : 3 sec </p>
  
  <p>2017-12-06 09:08:48:06963100 => [3B07B7743F4EAD58CD] CURL Request: {{json data}}</p>
  
  <p>2017-12-06 09:08:51:69533700 => [3B07B7743F4EAD58CD] CURL Response: {{json data}}</p>
  
  <p>//Error.. Returning null after 10 sec</p>
  
  <p>2017-12-06 08:51:35:74268300 => [F1461F1921E49ED226] CURL Request: {{json data}}</p>
  
  <p>2017-12-06 08:51:45:94968500 => [F1461F1921E49ED226] CURL Response: null</p>