I use the same curl code in symfony command and symfony controller, in command it works while in controller it doesn't. Does anybody know why?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$data = json_decode(curl_exec($ch),true);
curl_close($ch);