Environment
PHP Version : PHP 5.6.21
cURL Version : curl 7.29.0
Web Server : Nginx
Linux : Cent OS
Description
I have this CURL in PHP.
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
"Authorization: Basic " . $auth_code
);
$data = 'grant_type=authorization_code&code='.$code;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$AUTH_TOKEN_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1000);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_USERAGENT,'php');
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$info = curl_getinfo($ch);
$result = curl_exec($ch);
I did a Wireshark capture, I don't any GET/POST requests initiating.
What could possibly prevent it?
What else should I look into ?
I've tried print out these 2 values
**dd($ch);**
I got
"ch" => curl resource @10 ▼
url: "https://www.web.com/oauth"
content_type: null
http_code: 0
header_size: 0
request_size: 0
filetime: -1
ssl_verify_result: 0
redirect_count: 0
total_time: 0.004216
namelookup_time: 0.004148
connect_time: 0.113475
pretransfer_time: 0.0
size_upload: 0.0
size_download: 0.0
speed_download: 0.0
speed_upload: 0.0
download_content_length: -1.0
upload_content_length: -1.0
starttransfer_time: 0.0
redirect_time: 0.0
redirect_url: ""
primary_ip: "8.8.8.8"
certinfo: []
primary_port: 443
local_ip: "10.0.129.127"
local_port: 56907
}
**dd($info);**
I got
"info" => array:26 [▼
"url" => "https://www.web.com/oauth"
"content_type" => null
"http_code" => 0
"header_size" => 0
"request_size" => 0
"filetime" => 0
"ssl_verify_result" => 0
"redirect_count" => 0
"total_time" => 0.0
"namelookup_time" => 0.0
"connect_time" => 0.0
"pretransfer_time" => 0.0
"size_upload" => 0.0
"size_download" => 0.0
"speed_download" => 0.0
"speed_upload" => 0.0
"download_content_length" => -1.0
"upload_content_length" => -1.0
"starttransfer_time" => 0.0
"redirect_time" => 0.0
"redirect_url" => ""
"primary_ip" => ""
"certinfo" => []
"primary_port" => 0
"local_ip" => ""
"local_port" => 0
]
nothing seems to use in there.
Questions
How would one go about and debug this further ?
I'm open to any suggestions at this moment.
Any hints/suggestions / helps on this be will be much appreciated!