1

I've got aproblem with my php cUrl. It doesn't output anything so whenever i run this it will return: "didnt work"

$curl = curl_init();
$url = "https://www.google.com/";
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
if ($result === FALSE) {
   print "didnt work!";
} else {
   print "worked!";
}

I've searched countless tutorials etc. and no sulotion worked for me. Thx for the help in advance :)

Jan
  • 11
  • 1
  • you need to setup properly for `https` , both the environment (CA certs), and the curl call itself. – YvesLeBorg Feb 20 '19 at 13:01
  • Thank you sooo much o.o – Jan Feb 20 '19 at 13:05
  • Unable to reproduce - works (just some relative image links should be fixed to be absolute paths). Have you tried to output http response header ? Try adding option `curl_setopt($curl, CURLOPT_HEADER, 1);` and see the exact output with `echo "$result";`. What do you see ? – Agnius Vasiliauskas Feb 20 '19 at 13:28

0 Answers0