How to check if curlSSL is working properly.

cUrl is a library PHP uses to access HTTP based webservices and websites. At least some of these webservices and websites require you to use HTTPS (SSL) for security reasons.

Here is how to check if your webserver is correctly configured with CurlSSL.

Please create the .php file with this content (click “Text” or “Popup” and copy-paste the code to .php file ) anywhere on your server and open it from your browser.

function nxs_cURLTest($url, $msg, $testText){  
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, $url); 
  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36"); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  $response = curl_exec($ch); 
  $errmsg = curl_error($ch); 
  $cInfo = curl_getinfo($ch); 
  echo "Testing ... ".$url." - ".$cInfo['url']."<br />";
  if (stripos($response, $testText)!==false) 
    echo "....".$msg." - OK<br />"; 
    echo "....<b style='color:red;'>".$msg." - Problem</b><br /><pre>"; 
    echo "</pre>There is a problem with cURL. You need to contact your server admin or hosting provider.";

  nxs_cURLTest("", "HTTPS to NXS", "Social Networks");
  nxs_cURLTest("", "HTTP to Google", "Mountain View, CA");
  nxs_cURLTest("", "HTTPS to Google", "Mountain View, CA");
  nxs_cURLTest("", "HTTPS to Facebook", 'id="facebook"');
  nxs_cURLTest("", "HTTPS to API (Graph) Facebook", 'get');  
  nxs_cURLTest("", "HTTPS to LinkedIn", 'rel="canonical" href="');
  nxs_cURLTest("", "HTTPS to Twitter", '
The correct result should look like this:


Live example:

If you get any errors, please contact your server admin or hosting provider.
© 2012-2016