Note: I am running OS X Yosemite. I believe this works with Mavericks too.
After looking a several answers and combining them mixing and matching etc. Here is a rough explanation on what I did.
- Open the command line and run:
locate cacert.pem
This will list all the locations where your certificates are.
My result:
/Applications/Adobe Dreamweaver CS6/Configuration/Certs/cacert.pem
/Applications/MAMP/Library/lib/python2.7/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/_vendor/requests/cacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_asyncio/pycacert.pem
/Users/robert/.composer/cacert.pem
/opt/vagrant/embedded/cacert.pem
/usr/ssl/certs/cacert.pem
- I downloaded the most recent one from curl
http://curl.haxx.se/docs/caextract.html
- I made a directory in
/usr/ssl/certs/
and put the downloaded cert there /usr/ssl/certs/cacert.pem
I opened up my php.ini file and placed this line at the top of the file:
openssl.cafile=/usr/ssl/certs/cacert.pem
Restart apache (stop apache and start it again)
Everything worked out for me.
Now one thing that I do believe needs to be done is you need to tell the command line which PHP you are referring to. I am running PHP under XAMPP and not natively on my OS X. So the command line will think that you are referring to the native PHP on OS X and not the one running on XAMPP. This needs to be changed I believe for this to work. If not then it should be good.
As mentioned this solution worked for me.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…