PHP通过openssl创建密钥

WBOY
Release: 2016-06-23 14:05:16
Original
1043 people have browsed it

$res = openssl_pkey_new(array("config" => "D:/php/extras/openssl/openssl.cnf")
); 
echo openssl_error_string();
if(empty($res))
{
// echo "error: no key was generated by openssl_pkey_new()
";
}
else
{
// echo "a private key was generated by openssl_pkey_new()
";
}
openssl_pkey_export($res, $privatekey);
exit;
?>
结果显示
error:02001003:system library:fopen:No such process
我的php版本是5.2 phpinfo()里面 openssl 是enable。网上又说是找不到openssl.cnf,可是我已经附了绝对路径。小弟是个新手,望大家指教


回复讨论(解决方案)

如果保证安装正确,估计是版本不匹配吧

openssl是php自带的呀,而且我已经把两个lib文件复制到system32里还是没有效果

兄弟怎么解决的?

会不会是没有权限访问openssl.cnf?

搞定没有,? 我也遇到了这问题

最后用apache下自带的openssl.exe生成的密钥对,在php下也能用

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template