1

Follow up on the answer given here https://stackoverflow.com/a/2602624/37759

This solution works for image or pdfs, however, when I try it with text or javascript files curl_exec return false. Why?

For example getting file size of jquery file https://raw.github.com/jquery/jquery/master/src/ajax.js

Community
  • 1
  • 1
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247

1 Answers1

2

This probably has to do with GitHub URL being https. You can tell cURL go ignore the certificate check, by doing:

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);

If this doesn't solve the issue, you can add a echo curl_error($curl) before curl_close( $curl ); -- it might help you with debugging.

Amal Murali
  • 75,622
  • 18
  • 128
  • 150
  • 1
    `curl_error($curl)` after the `curl_exec()` yields "SSL certificate problem: unable to get local issuer certificate" here, confirming https being the root of the problem. – ax. Nov 06 '13 at 18:37