PHP OpenSSL-openssl_private_encrypt使网页崩溃 [英] PHP OpenSSL - openssl_private_encrypt crashes webpage

查看:404
本文介绍了PHP OpenSSL-openssl_private_encrypt使网页崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已在 bugs.php.net bugs.php.net .如果我将xampp/apache/bin中的 libeay32.dll和ssleay32.dll 替换为xampp/php/中的相同文件,则它可以工作,但我不能使用SSL

This has been reported at bugs.php.net. If I replace libeay32.dll and ssleay32.dll in xampp/apache/bin with the same files in xampp/php/ then it works but I CANNOT use SSL

我需要使用SSL,有人能解决吗?

I need to use SSL, has anyone been able to resolve this?

我正在使用 XAMPP (1.8.1)上 PHP (5.4.7)中的 OpenSSL 库进行加密,解密等操作.我也在本地主机上使用SSL.

I am using OpenSSL library in PHP(5.4.7) on XAMPP(1.8.1) for encryption, decryption, etc. I am also using SSL on localhost.

我可以使用openssl_pkey_new()方法创建私钥-公钥对,并生成证书.

I am able to create the private-public key pair using openssl_pkey_new() method and generate the certificate as well.

但是,当我尝试访问我的根证书(使用上述功能创建)时,网页崩溃:

But when I try to access my root certificate (create using the above function) the webpage crashes:

$root_private_key = openssl_get_privatekey(file_get_contents($path), $pass);
echo "KEY: " . $root_private_key; // KEY: Resource id #11
openssl_private_encrypt($plaintext, $encrypted_data, $root_private_key);

我什至尝试使用 phpseclib库,但这也做同样的事情.

I even tried using phpseclib library but that also does the same thing.

我也尝试设置ini_set('max_execution_time', 0);

我检查了 PHP日志,它为空,并在 Apache日志中找到了以下内容:

I checked PHP log and it is empty and found the following in Apache logs:

[mpm_winnt:notice] [pid 3312:tid 484] AH00428: Parent: child process exited with status 3221225477 -- Restarting.
[ssl:warn] [pid 3312:tid 484] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[mpm_winnt:notice] [pid 3312:tid 484] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[mpm_winnt:notice] [pid 3312:tid 484] AH00456: Server built: Aug 18 2012 12:41:37
[core:notice] [pid 3312:tid 484] AH00094: Command line: 'apache\\bin\\httpd.exe -d C:/xampp/apache'
[mpm_winnt:notice] [pid 3312:tid 484] AH00418: Parent: Created child process 1520
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/xampp/apache/conf/extra/httpd-vhosts.conf:19
[ssl:warn] [pid 1520:tid 496] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[mpm_winnt:notice] [pid 1520:tid 496] AH00354: Child: Starting 150 worker threads.


我尝试了以下操作,但无济于事:


I have tried following but none of that helps:

PHP openssl_public_encrypt导致页面超时/连接重置?

php/timeout/连接到服务器重置?

使用openssl函数时,Apache服务器(xampp)崩溃

PHP意外死亡而没有错误

我将不胜感激.

推荐答案

已在 bugs.php.net .如果我将 xampp/apache/bin 中的以下文件替换为 xampp/php/中的相同文件,那么它将起作用:

This has been reported at bugs.php.net. If I replace the following files in xampp/apache/bin with the same files in xampp/php/ then it works:

  • libeay32.dll
  • ssleay32.dll
  • libeay32.dll
  • ssleay32.dll

但是,不能使用SSL ,否则Apache在启动时会给出错误消息.

BUT, SSL cannot be used otherwise Apache gives error when starting up.

这篇关于PHP OpenSSL-openssl_private_encrypt使网页崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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