Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Making CURL SSL Work on Localhost PHP Development in Windows
Posted on 08/08/2014 at 09:52 am by Kevin Wentworth
Viewed 14,323 times | 0 comments
I've been here before. Working on a Facebook application on my local development box and none of the access tokens will work. They work on the live server, but not on my sandbox/development server. What gives?
CURL is failing to communicate over SSL/HTTPS
If you dig into the code and look at the curl error being reported, you'll see this message:
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
That sounds ominous. But I know I had it working at some point in the past. The culprit here: I reinstalled PHP on my computer and forgot a key CURL setting. To get curl working over SSL connections on PHP for Windows (without disabling the SSL check using curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);) you'll have to modify your PHP.ini. (or update all your code... no thanks!).
Add PHP.ini Setting for curl.cainfo
The fix is easy. Open up your php.ini file and add the following line (there won't be any curl options if you are using WAMP).
- curl.cainfo = "C:\path\to\cacert.pem"
Cheers,
-Kevin Wentworth
Tags for Making CURL SSL Work on Localhost PHP Development in Windows
Web Programming | Web Server Admin | Windows | Php | Usage | Setup
Comments for this Posting
No comments. Be the first to post a reply.
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!