openssl_pkey_export(): cannot get key from parameter 1

背景:

系统:win10, 使用xampp最新版(支持php7)调试lavavel项目

已经配置了 【xampp根目录】/apache/conf/extra/httpd-vhosts.conf进行本地测试,如:

<VirtualHost *:443>
DocumentRoot "E:/work/Project/PHPPro/test"
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
</VirtualHost>

在php使用opensll的时候抛出异常: openssl_pkey_export(): cannot get key from parameter 1 异常


解决方法:

打开环境变量,添加 openssl.cnf 文件到系统环境变量

变量名:OPENSSL_CONF

openssl.cnf 文件的路径:  【xampp根目录】/apache/conf/openssl.cnf

设置完后,重启电脑



猜你喜欢

转载自blog.csdn.net/baijinwen/article/details/78850652