Getting cURL timeout error using Goutte, even with config settings Getting cURL timeout error using Goutte, even with config settings curl curl

Getting cURL timeout error using Goutte, even with config settings


"GuzzleHttp" code has been updated. Hence you need to set the curl as follow

$client = new \Goutte\Client();$guzzleClient = new \GuzzleHttp\Client(array(    'curl' => array(        CURLOPT_TIMEOUT => 60,    ),));$client->setClient($guzzleClient);$crawler = $client->request('GET', $my_url); 


Ok, I figured out the issue with my code.

It was precedence. I placed this:

$client->getClient()->setDefaultOption('config/curl/'.CURLOPT_TIMEOUT, 0);$client->getClient()->setDefaultOption('config/curl/'.CURLOPT_TIMEOUT_MS, 0);$client->getClient()->setDefaultOption('config/curl/'.CURLOPT_CONNECTTIMEOUT, 0);$client->getClient()->setDefaultOption('config/curl/'.CURLOPT_RETURNTRANSFER, true);

before:

$crawler = $client->request('GET', $my_url);

And it worked!


I faced this same issue. Are you using goutte.phar downloaded from git?

If so, that is the problem.

Use the actual source files via autoloading composer and it should work.