windows 为什么 openssl_pkey_new() 失败?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4282507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why does openssl_pkey_new() fail?
提问by Mawg says reinstate Monica
I'm very new to this. Why is openssl_pkey_new()
returning false?
我对此很陌生。为什么openssl_pkey_new()
返回false?
I am using XAMPP and there is a an OpenSSL under the Apahce\bin
directory.
我正在使用 XAMPP,并且Apahce\bin
目录下有一个 OpenSSL 。
What obvious beginner mistake am I making? Maybe it's a matter of SSL configuration?
我犯了什么明显的初学者错误?也许这是 SSL 配置的问题?
My goal is to write the two keys into two files.
我的目标是将两个密钥写入两个文件。
Update: as suggested, I used openssl_error_string()
and it says error:02001003:system library:fopen:No such process
. It sounds like maybe OpenSSL isn't running or isn't in the path?? Any ideas?
更新:正如建议的那样,我使用了openssl_error_string()
它,它说error:02001003:system library:fopen:No such process
。听起来可能 OpenSSL 没有运行或不在路径中?有任何想法吗?
Update: I put c:\xampp\php
into the windows path, so that it could find libeay32.dll
and restarted Apache.
更新:我放入c:\xampp\php
windows 路径,以便它可以找到libeay32.dll
并重新启动 Apache。
Now I get error:2006D080:BIO routines:BIO_new_file:no such file
. Any ideas?
现在我明白了error:2006D080:BIO routines:BIO_new_file:no such file
。有任何想法吗?
回答by caf
Use openssl_error_string()
to find out why openssl_pkey_new()
is returning false (or any other OpenSSL error).
使用openssl_error_string()
找出为什么openssl_pkey_new()
被返回false(或任何其他OpenSSL的错误)。
After your latest update, it appears that OpenSSL can't find the openssl.cnf
file, as described here.
在您的最新更新之后,OpenSSL 似乎无法找到该openssl.cnf
文件,如此处所述。