我必须对我的 xampp (Windows) 上的 OpenSSL 扩展工作做些啥? :( [复制]

Posted

技术标签:

【中文标题】我必须对我的 xampp (Windows) 上的 OpenSSL 扩展工作做些啥? :( [复制]【英文标题】:What I have to do to OpenSSL extension work on my xampp (Windows)? :( [duplicate]我必须对我的 xampp (Windows) 上的 OpenSSL 扩展工作做些什么? :( [复制] 【发布时间】:2012-04-05 01:42:14 【问题描述】:

我已经尝试了所有......但不起作用!我确实将 libeay32.dll 和 ssleay32.dll 放在 System32 windows 文件夹中,并在 php.ini 上启用了 php_openssl.dll 扩展。但是,当执行以下代码时,会发生一些错误。我的 openSSL 版本是 1.0.0。谁能帮帮我?

代码:

$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 

【问题讨论】:

你在修改 php.ini 后尝试过重启 apache 吗? 【参考方案1】:

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

'config' => 'openssl.cnf',

它存在吗?尝试使用绝对路径,或相对于 CWD。​​p>

【讨论】:

终于可以工作了...但是现在我遇到了另一个麻烦... :(当我尝试获取有关生成的私有 rsa 密钥的信息时(使用 openssl_pkey_get_details),即,当我执行 php 脚本时,页面重启连接,不执行!会是什么问题? 是否可以在不使用 openssl.cnf 的情况下生成 RSA 私钥?

以上是关于我必须对我的 xampp (Windows) 上的 OpenSSL 扩展工作做些啥? :( [复制]的主要内容,如果未能解决你的问题,请参考以下文章

我无法在我的系统 windows 7 32 位上的 XAMPP 上启动 Apache

为啥我无法访问本地 XAMPP 上的某些页面或目录?

在 windows 平台上的 Xampp 上运行 Python 代码

mac上的Xampp mailoutput文件夹在哪里?

在 xampp Windows 7 上安装时必须加载 PHP 扩展“curl”

为啥我的 XAMPP Apache 服务不断重启?