Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 窗口WAMP报告';SSL证书问题:无法获取本地颁发者证书';使用带有curl扩展名的https请求时_Php_Curl_Https_Window_Certificate - Fatal编程技术网

Php 窗口WAMP报告';SSL证书问题:无法获取本地颁发者证书';使用带有curl扩展名的https请求时

Php 窗口WAMP报告';SSL证书问题:无法获取本地颁发者证书';使用带有curl扩展名的https请求时,php,curl,https,window,certificate,Php,Curl,Https,Window,Certificate,它在我的centos7 linux环境中工作。 但它在我的windowwamp(PHP7.0)环境中报告了“SSL证书问题:无法获取本地颁发者证书” 这是我的php curl版本 这是我的密码 $func = function ($url, $post) { $header[] = "Content-type: text/xml"; $curl = curl_init(); curl_setopt($cu

它在我的centos7 linux环境中工作。 但它在我的windowwamp(PHP7.0)环境中报告了“SSL证书问题:无法获取本地颁发者证书”

这是我的php curl版本

这是我的密码

$func = function ($url, $post)
        {
            $header[] = "Content-type: text/xml";

            $curl = curl_init();
            curl_setopt($curl, CURLOPT_URL, $url);
            curl_setopt($curl, CURLOPT_HEADER, 1);
            curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_POST, 1);
            curl_setopt($curl, CURLOPT_SSLCERTTYPE,'PEM');
            curl_setopt($curl, CURLOPT_SSLCERT, './cert.pem');
            curl_setopt($curl, CURLOPT_SSLKEYTYPE,'PEM');
            curl_setopt($curl, CURLOPT_SSLKEY,'./key.pem');
            curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
            $data = curl_exec($curl);
            if ($data) {
                curl_close($curl);
            } else {
                $data = curl_error($curl);
                curl_close($curl);
            }

            return $data;
        };

var_dump($func($url, $post));
嗯。我解决了。 只需在php.ini中使用'curl.cainfo'参数配置CA路径。 以下是链接: 好的。我解决了。 只需在php.ini中使用'curl.cainfo'参数配置CA路径。 以下是链接: