My OS window 7 using Xampp server. In my localhost i got output but using https protocols means i am getting empty response. May I need to update any thing in my below code to get website content.
print_r(curl_version());
Output
Array
(
[version_number] => 470785
[age] => 3
[features] => 266141
[ssl_version_number] => 0
[version] => 7.47.1
[host] => i386-pc-win32
[ssl_version] => OpenSSL/1.0.2d
[libz_version] => 1.2.7.3
[protocols] => Array
(
[0] => dict
[1] => file
[2] => ftp
[3] => ftps
[4] => gopher
[5] => http
[6] => https
[7] => imap
[8] => imaps
[9] => ldap
[10] => pop3
[11] => pop3s
[12] => rtsp
[13] => scp
[14] => sftp
[15] => smtp
[16] => smtps
[17] => telnet
[18] => tftp
)
)
My curl program:
// is cURL installed yet?
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');
}
// OK cool - then let's create a new cURL resource handle
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com/sites/AAA/default.aspx');
curl_setopt($ch, CURLOPT_REFERER, 'https://example.com/sites/AAA/default.aspx');
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla15-1.0");
//curl_setopt ($ch, CURLOPT_PORT , 8089);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch); print_r( $output);
curl_close($ch);