title: cURL request works fine locally but isn't returning any data on the remote server
body: <p>I have a Laravel 8.x application that does a php cURL request on a cronjob to pull in some data from the EA.com website for the FIFA 22 videogame - it has recently stopped working for some reason, when I try this using the same codebase on my local machine it all works fine. However when I try this using my live app on a remote server it no longer returns the expected data (on a LEMP stack Digital Ocean droplet).</p>
  <p>I cannot be sure if EA are blocking my requests but I'm just trying to figure out what I can do next as I only get an issue</p>
  <pre><code>    private function doExternalApiCall($endpoint = null, $params = [])
      {
          $url = $this-&gt;apiUrl . $endpoint . http_build_query($params);
          // e.g $url = https://proclubs.ea.com/api/fifa/clubs/matches?matchType=gameType9&amp;platform=ps5&amp;clubIds=310718
          dump($url);
  
          $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; 3,    // i have tried experimenting with other numbers
              CURLOPT_FOLLOWLOCATION =&gt; true,
              CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST =&gt; 'GET',
              CURLOPT_HTTPHEADER =&gt; array(
                'accept: application/json', 
                'Referer: https://www.ea.com/',
              ),
            ));
  
            if(curl_exec($curl) === false)
            {
                echo 'Curl error: ' . curl_error($curl);
            }
            else
            {
                echo 'Operation completed without any errors';
            }          
  
            if(curl_errno($curl))
            {
                echo 'Curl error: ' . curl_error($curl);
            } 
            
            $response = curl_exec($curl);
            curl_close($curl);
  
            dump($response);  // should return json data but on live it returns false
            return $response;
      }
  </code></pre>
  <p>// Expected output in the terminal when the cronjob is run on live (this is what I see when running from my local machine)</p>
  <pre><code>&quot;https://proclubs.ea.com/api/fifa/clubs/matches?matchType=gameType9&amp;platform=ps5&amp;clubIds=310718&quot;
  &quot;[{&quot;matchId&quot;:&quot;9798251730479&quot;,&quot;timestamp&quot;:1636584075,&quot;timeAgo&quot;:{&quot;number&quot;:2,&quot;unit&quot;:&quot;days&quot;},&quot;clubs&quot;:...... &lt;more json data&gt;
  </code></pre>
  <p>// Actual behaviour when cronjob is run on live site</p>
  <pre><code>&quot;https://proclubs.ea.com/api/fifa/clubs/matches?matchType=gameType9&amp;platform=ps5&amp;clubIds=310718&quot;
  false
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cZVHj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cZVHj.png" alt="Running cronjob on my local machine" /></a></p>
  <p><a href="https://i.stack.imgur.com/NFSzq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NFSzq.png" alt="Running cronjob on my remote server at proclubs.app" /></a></p>
  <p>When running this on my local - the response is instant and returns the expected data, where on live the requests are taking slightly longer and it returns <code>FALSE</code></p>
  <p>Any suggestions on what I should do next?</p>
  <p>-- update --
  I have added the additional lines to get the curl error and I get the following:</p>
  <pre><code>Curl error: Operation timed out after 10001 milliseconds with 0 bytes receivedCurl error: Operation timed out after 10001 milliseconds with 0 bytes received
  </code></pre>