Hey guys i'm trying to make a curl request to facebook Graph API, but when i use $curl_exec it returns nothing.
My code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, BioCommandController::getGraphUrl(). $this->{self::AD_ACCOUNT_ID}.'/offsitepixels?'.$fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec($ch);
curl_getinfo() response:
Array
(
[url] => https://graph.facebook.com/v2.3/ MY DATA
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 1
[redirect_count] => 0
[total_time] => 0.031
[namelookup_time] => 0
[connect_time] => 0.016
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 2a03:2880:f005:1:face:b00c:0:1
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => 2804:7f5:f180:dc6d:c5e5:3e79:d447:d583
[local_port] => 54603
)
I'm new to Curl so i have no idea how to interpretate the getinfo response, also i have tested my graph api resuqest on my browser and it works, it returns what i need! And also even if i was generating something weong on my graph API request Facebook always answers something for example:
{ "error": { "message": "An active access token must be used to query information about the current user.", "type": "OAuthException", "code": 2500 } }
Does anyone know whats going on? I can't seem to figure it out, thanks!
UPDATE
id runed this code (So u can really know what's going on wwith curl)
if ($return === false) { die(curl_error($ch)); }
and i got this:
SSL certificate problem: unable to get local issuer certificate