title: 500 internal server error when trying to execute CURL
body: <p>Hello i am having an issue here, i get a 500 internal server error when i try to execute curl on my server.  I contacted support and they claim it's my .htaccess file and there is nothing they can do about it.</p>
  
  <p>This is my code:</p>
  
  <pre><code>$api_key = 'f7cb125a449f4f908931f360ac33b52a';
  $server_ip = '162.13.170.20';
  $port = '5000';
  $url = "https://".$server_ip.":".$port."/api/fusion/tp/".$api_key;
  
  // Get cURL resource
  $curl = curl_init();
  // Set some options - we are passing in a useragent too here
  curl_setopt_array($curl, array(
      CURLOPT_RETURNTRANSFER =&gt; 1,
      CURLOPT_URL =&gt; $url,
      CURLOPT_USERAGENT =&gt; 'myTicketGH',
      CURLOPT_POST =&gt; true,
      CURLOPT_POSTFIELDS =&gt; array(
          'kuwaita' =&gt; 'malipo',
          'amount' =&gt; $calculated_total_cost,
          'mno' =&gt; $network,
          'msisdn' =&gt; $phone
      )
  ));
  // Send the request &amp; save response to $resp
  $resp = curl_exec($curl);
  // Close request to clear up some resources
  curl_close($curl);
  
  return [
      'response' =&gt; $resp
  ];
  </code></pre>
  
  <p>And this is my .htaccess file:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      Options +FollowSymLinks
      RewriteEngine on
  
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
  
      RewriteRule . index.php [L]
  
       RewriteEngine On
       RewriteCond %{HTTP:Authorization} .
       RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Is there a <strong>laravel</strong> way of using CURL? Because i can't understand how there can be a problem with my .htaccess file but my application still runs.</p>
  
  <p>I contacted support, apparently this is my error_log:</p>
  
  <pre><code>[Tue Sep 29 09:31:20 2015] [warn] [client 69.195.125.1] mod_fcgid: read data timeout in 40 seconds
  [Tue Sep 29 09:31:20 2015] [error] [client 69.195.125.1] Premature end of script headers: index.php
  [Tue Sep 29 09:31:20 2015] [error] [client 69.195.125.1] File does not exist: /home/mytickf1/public_html/500.shtml
  [Tue Sep 29 09:31:26 2015] [warn] mod_fcgid: process 14879 graceful kill fail, sending SIGKILL
  </code></pre>
  
  <p>I should also add that my server uses a dedicated IP address.</p>