How can I set CURLOPT_CAINFO globally for PHP on Windows?

后端 未结 5 1842
天命终不由人
天命终不由人 2020-12-14 01:59

I understand that I can set the option on any specific instance, however what I would really like is to set something up php.ini or somewhere similar which will handle this

5条回答
  •  别那么骄傲
    2020-12-14 02:20

    Here is a patch to 'emulate' what we can see on linux when a valid crt data has been found at build time (which is the case for almost all distros):

    http://www.php.net/~pierre/patches/curl_cacert_default.txt

    it adds a (system) ini settings to define the path to the cacert, curl.cainfo=c:\curl\ca.crt

    cacert data can be fetched here: http://curl.haxx.se/docs/caextract.html

    DLL for php 5.3 can be found here: http://www.php.net/~pierre/test/curl-5.3-vc9-x86-ts-nts-cainfodefault.zip DLL for php 5.2 can be found here: http://www.php.net/~pierre/test/curl-5.2-cainfodefault.zip

    Please let me know how it works.

提交回复
热议问题