How can I set CURLOPT_CAINFO globally for PHP on Windows?

后端 未结 5 1843
天命终不由人
天命终不由人 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:44

    I found the answer here (in the user notes): http://php.net/manual/en/function.curl-setopt.php

    Just add this to you .ini (note: you cannot use ini_set, although I don't know why you would want to. Thanks @Carlton):

    curl.cainfo=c:\php\cacert.pem
    

    And get that file from: http://curl.haxx.se/docs/caextract.html

    Works and you aren't opening yourself up for MITM attacks

提交回复
热议问题