在xampp(Windows)上对OpenSSL扩展进行工作时我需要做什么? :( [英] What I have to do to OpenSSL extension work on my xampp (Windows)? :(

查看:209
本文介绍了在xampp(Windows)上对OpenSSL扩展进行工作时我需要做什么? :(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了所有....但是没有用!我确实将libeay32.dll和ssleay32.dll放在System32 Windows文件夹上,并在php.ini上启用了php_openssl.dll扩展名.但是,当执行以下代码时,会发生一些错误.我的openSSL版本是1.0.0.有人可以帮助我吗?

I've already tried all.... but not works! I did put libeay32.dll and ssleay32.dll on System32 windows folder and I enabled php_openssl.dll extension on php.ini. But, when executes following code, some errors occurs. My openSSL version is 1.0.0. Anyone can help me?

代码:

$configargs = array(
    'config' => 'openssl.cnf',
    'digest_alg' => 'md5',
    'x509_extensions' => 'v3_ca',
    'req_extensions'   => 'v3_req',
    'private_key_bits' => 666,
    'private_key_type' => OPENSSL_KEYTYPE_RSA,
    'encrypt_key' => false,
    );

$dn = array(
    "countryName" => "DE",
    "stateOrProvinceName" => "wubbla wubbla",
    "localityName" => "wubbla",
    "organizationName" => "Internet Widgits Pty Ltd",
    "organizationalUnitName" => "Organizational Unit Name",
    "commonName" => "example.com",
    "emailAddress" => "Email Address"
);

$csr = openssl_csr_new($dn, $privkey, $configargs);

// Show any errors that occurred here
while (($e = openssl_error_string()) !== false) {
    echo $e . "\n";
   }

错误:

error:02001003:system library:fopen:No such process
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib
error:02001002:system library:fopen:No such file or directory
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib 

推荐答案

好吧,根据错误消息,它无法fopen()配置文件,您将其配置为:

Well, according to the error message, it fails to fopen() the config file, which you configured as:

'config' => 'openssl.cnf',

它存在吗?尝试使用绝对路径或相对于CWD的绝对路径.

Does it exist? Try using an absolute path, or relative to CWD.

这篇关于在xampp(Windows)上对OpenSSL扩展进行工作时我需要做什么? :(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆