First:
Check certificate file location which will be in default_cert_file key, you will found it in openssl_get_cert_locations() its php openssl function: 第一步:需找验证钥匙的地址,使用 php函数openssl_get_cert_locations().
$ php -r "print_r(openssl_get_cert_locations());"
Array ( [default_cert_file] => /opt/lampp/share/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /opt/lampp/share/openssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => /opt/lampp/share/openssl/private [default_default_cert_area] => /opt/lampp/share/openssl [ini_cafile] => [ini_capath] => )
Second:
Download http://curl.haxx.se/ca/cacert.pem: 第二步:下载最新的cacert.pem,从上面这个网址下。
$ wget http://curl.haxx.se/ca/cacert.pem Third:
Copy certificate PEM file into default_cert_file location: 第三步:建立openssl到默认cert文件到连接。
$ sudo mv cacert.pem /opt/lampp/share/openssl/cert.pem My php-cli is under XAMPP and default_cert_file maybe point to some place that is different than this. 注意:这个要跟上面第一步找到到地址一致。
Fourth:
Restart xampp: 重启xampp
$ sudo /opt/lampp/xampp restart I hope anything after that should goes fine with you brothers. 希望你顺利解决。
路径和重启php的命令参照自己的配置修改。
|