PHP openssl_public_encrypt 导致页面超时/连接重置? [英] PHP openssl_public_encrypt causing Page Timeout/Connection Reset?
问题描述
刚刚迁移到一台新机器并且遇到了问题.
Just migrated to a new machine and having issues.
注意:这是 Windows 7、Apache 2.2.21、MySQL 5.5.16、php 5.3.8 设置.
每次运行某个 PHP 脚本时,都会遇到页面加载错误 - 连接已重置".我知道脚本在使用各种 echo 语句的函数调用之前工作,但调用:
Each time I run a certain PHP script, I am faced with a "Page Load Error - The connection was reset". I know the script works before the function call with various echo statements but calling:
openssl_public_encrypt();
openssl_public_encrypt();
我得到了一个页面超时.我已将适当的 openssl.dll PATH 添加到我的 Windows 配置设置 (D:\xampp\php\etc),但我仍然在我的实际 localhost 机器上收到页面超时错误(以及上面的错误).
I am given a page timeout. I have added the appropriate openssl.dll PATH to my windows configuration settings (D:\xampp\php\etc) but I am still getting page timeout errors on my actual localhost machine (and the errors above).
页面返回:
连接已重置
- 在加载页面时重置了与服务器的连接.
apache ssl 日志显示:
The apache ssl logs show:
[2011 年 12 月 7 日星期三 15:13:17] [信息] 加载证书 &SSL感知服务器的私钥
[Wed Dec 07 15:13:17 2011] [info] Loading certificate & private key of SSL-aware server
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_pphrase.c(470):未加密的 RSA 私钥 - 不需要密码
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_pphrase.c(470): unencrypted RSA private key - pass phrase not required
[Wed Dec 07 15:13:17 2011] [info] 为 SSL 协议配置服务器
[Wed Dec 07 15:13:17 2011] [info] Configuring server for SSL protocol
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(465):创建新的 SSL 上下文(协议:SSLv2、SSLv3、TLSv1)
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(465): Creating new SSL context (protocols: SSLv2, SSLv3, TLSv1)
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(420):配置 TLS 扩展处理
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(420): Configuring TLS extension handling
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(795):配置 RSA 服务器证书
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(795): Configuring RSA server certificate
[Wed Dec 07 15:13:17 2011] [warn] RSA 服务器证书 CommonName (CN) `localhost' 与服务器名称不匹配!?
[Wed Dec 07 15:13:17 2011] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(834):配置 RSA 服务器私钥
[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(834): Configuring RSA server private key
PHPinfo() 显示:
PHPinfo() shows:
**
**
OpenSSL support | enabled
----------------------------------------------------------
OpenSSL Library Version | OpenSSL 1.0.0e 6 Sep 2011
----------------------------------------------------------
OpenSSL Header Version | OpenSSL 0.9.8r 8 Feb 2011
-
我的库和标头版本不应该匹配吗?这可能是我错误的原因吗?
Shouldn't my library and header versions match? Could this be the cause of my error?
推荐答案
请注意,这是在 apache 和 php 的最新版本中发现的错误.Apache 版本使用了不兼容的文件.解决(暂时只在本地机器上):
Of note, this is an error found in recent versions of apache and php. The Apache version used non-compatible files. To resolve (temporarily on local machines only):
替换 xampp/apache/bin 文件夹中的以下两个文件:
Replace the following two files in your xampp/apache/bin folder:
- libeay32.dll
- ssleay32.dll
使用您的 xampp/php 文件夹中的同名文件.这个问题立即为我解决了.
with the files of the same name in your xampp/php folder. The issue was resolve for me immediately.
这篇关于PHP openssl_public_encrypt 导致页面超时/连接重置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!