I am trying to get a basic cURL request to work. I am running Wamp 2.5 and PHP 5.5.12. I've double checked the php.ini files and have made sure cURL was actually set up and ready to go. Here is my code:
$url = "https://www.google.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
$response = curl_exec($ch);
echo $status_code;
There is no error returned except "0", and if I do var_dump the result is "boolean false". What am I doing wrong?
curl_exec()should be first