1
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, "https://duckduckgo.com/");
curl_exec($connection);
curl_close($connection);

This part of code return null on my wamp server. Work only if CURLOPT_URL is localhost resource. How to make curl work for web sites? file_get_contents() work well.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
God333
  • 11
  • 1
  • 2
    [`curl_error($connection)`](https://www.php.net/manual/en/function.curl-error.php) What does that tell you. OR Add [error reporting](http://stackoverflow.com/questions/845021/) to the top of your file(s) _while testing_ right after your opening PHP tag for example. Even if you are developing on a server configured as LIVE you will now see any errors. ` – RiggsFolly Sep 07 '20 at 12:26
  • I really recommend you to see this first https://stackoverflow.com/a/14436877/4906348 – Benyamin Limanto Sep 07 '20 at 12:55

0 Answers0