cURL error 60: SSL certificate: unable to get local issuer certificate

  • 21,000
  • Tác giả: admin
  • Ngày đăng:
  • Lượt xem: 21
  • Tình trạng: Còn hàng

For WAMP, this is what finally worked for bu.
While it is similar to tướng others, the solutions mentioned on this page, and other locations on the trang web did not work. Some "minor" detail differed.
Either the location to tướng save the PEM tệp tin mattered, but was not specified clearly enough.
Or WHICH php.ini tệp tin to tướng be edited was incorrect. Or both.
I'm running a 2020 installation of WAMP 3.2.0 on a Windows 10 machine.

Link to tướng get the pem file:

http://curl.haxx.se/ca/cacert.pem
Copy the entire page and save it as: cacert.pem, in the location mentioned below.

Save the PEM tệp tin in this location

\bin\php\php\extras\ssl
eg saved tệp tin and path: "T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"

*(I had originally saved it elsewhere (and indicated the saved location in the php.ini tệp tin, but that did not work). There might, or might not be, other locations also work. This was the recommended location - I vì thế not know why.)

WHERE
= path to tướng your WAMP installation.
eg: T:\wamp64\

of php that WAMP is running: (to find out, goto: WAMP icon tray -> PHP
if the version number shown is 7.3.12, then the directory would be: php7.3.12)
eg: php7.3.12

Which php.ini tệp tin to tướng edit

To open the proper php.ini tệp tin for editing, goto: WAMP icon tray -> PHP -> php.ini.
eg: T:\wamp64\bin\apache\apache2.4.41\bin\php.ini
NOTE: it is NOT the tệp tin in the php directory!

Update:
While it looked lượt thích I was editing the file: T:\wamp64\bin\apache\apache2.4.41\bin\php.ini,
it was actually editing that file's symlink target: T:/wamp64/bin/php/php7.3.12/phpForApache.ini.

Note that if you follow the above directions, you are NOT editing a php.ini tệp tin directly. You are actually editing a phpForApache.ini tệp tin. (a post with info about symlinks)

If you read the comments at the top of some of the php.ini files in various WAMP directories, it specifically states to tướng NOT EDIT that particular tệp tin.
Make sure that the tệp tin you vì thế open for editing does not include this warning.

Installing the extension Link Shell Extension allowed bu to tướng see the target of the symlink in the tệp tin Properites window, via an added tab. here is an SO answer of mine with more info about this extension.

If you run rẩy various versions of php at various times, you may need to tướng save the PEM tệp tin in each relevant php directory.

The edits to tướng make in your php.ini file:

Paste the path to tướng your PEM tệp tin in the following locations.

  • uncomment ;curl.cainfo = and paste in the path to tướng your PEM tệp tin.
    eg: curl.cainfo = "T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"

  • uncomment ;openssl.cafile= and paste in the path to tướng your PEM tệp tin.
    eg: openssl.cafile="T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"

Credits:

While not an official resource, here is a liên kết back to tướng the YouTube đoạn phim that got the last of the details straightened out for me: https://www.youtube.com/watch?v=Fn1V4yQNgLs.