Jump to content

Get errors from cURL functions


denoteone

Recommended Posts

I am trying to pull page data from a web server using SSL with cURL. The owner of the web server gave me their CA certificate. When I run the code below all I get is a blanks screen (no errors) Is there anyway I can show were the script is breaking down?

 

ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);

$url = "https://www.clientswebserver.com/";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_CAINFO, "/var/www/pathtoCAcert/curl-ca-bundle.crt");

$response = curl_exec($ch);
curl_close($ch);
print $response;

 

 

The original CA cert I got was not named curl-ca-bundle.crt  but I was told to rename it :confused:

Link to comment
https://forums.phpfreaks.com/topic/213625-get-errors-from-curl-functions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.