To extend the answer above and if the case is you are using XAMPP. In the current version of the xampp you cannot locate the curl_exec in the php.ini, just try using
<?php
echo '<pre>';
var_dump(curl_version());
echo '</pre>';
?>
and save to your htdocs. Next go to your browser and paste
http://localhost/[your_filename].php
if the result looks like this
array(9) {
["version_number"]=>
int(469760)
["age"]=>
int(3)
["features"]=>
int(266141)
["ssl_version_number"]=>
int(0)
["version"]=>
string(6) "7.43.0"
["host"]=>
string(13) "i386-pc-win32"
["ssl_version"]=>
string(14) "OpenSSL/1.0.2e"
["libz_version"]=>
string(5) "1.2.8"
["protocols"]=>
array(19) {
[0]=>
string(4) "dict"
[1]=>
string(4) "file"
[2]=>
string(3) "ftp"
[3]=>
string(4) "ftps"
[4]=>
string(6) "gopher"
[5]=>
string(4) "http"
[6]=>
string(5) "https"
[7]=>
string(4) "imap"
[8]=>
string(5) "imaps"
[9]=>
string(4) "ldap"
[10]=>
string(4) "pop3"
[11]=>
string(5) "pop3s"
[12]=>
string(4) "rtsp"
[13]=>
string(3) "scp"
[14]=>
string(4) "sftp"
[15]=>
string(4) "smtp"
[16]=>
string(5) "smtps"
[17]=>
string(6) "telnet"
[18]=>
string(4) "tftp"
}
}
curl is enable