我使用的PHP框架需要OpenSSL用于各种功能,但在执行与OpenSSL相关的任何内容时,我收到以下错误:“无法在DLL文件C:\ wamp64 \ bin \ apache \ apache2中找到序号372。 4.17 \ BIN \ openssl.exe”。
我根本不知道如何纠正这个问题,我已经到处寻找了。我很感激帮助,因为我不知道如何解决这个问题。
答案 0 :(得分:9)
要解决此问题,需要做两件事:
1)确保您的Apache bin目录中没有libeay32.dll和ssleay32.dll的符号链接 (例如,我的是:C:\ wamp64 \ bin \ apache \ apache2.4.23 \ bin)
如果您有符号链接(即文件大小为0字节),则需要从Apache Lounge下载dll。 例如,我从https://www.apachelounge.com/download/托管的64位版本的Apache 2.4.23中抓取了两个.dll文件
2)恢复实际的.dll文件后,您需要确保WampServer不会覆盖它们。 WampServer 3有一个配置脚本,每次启动时都会运行。在该脚本中,它将使用符号链接覆盖这些.dll。您必须禁用该功能。为此,请在以下位置注释掉对这两个文件的引用:C:\ wamp64 \ scripts \ config.inc.php(我的位于第133和139行)。
这应该允许您在Apache中启用mod_ssl模块。您还需要取消注释"包含conf / extra / httpd-ssl.conf"在启用mod_ssl的情况下正确启动Apache之后。 (但是,您可能需要删除其中的大部分内容并重新开始,因为它包含大量硬编码路径和错误)
答案 1 :(得分:1)
...“在DLL文件C中找不到序号372:\ wamp64 \ bin \ apache \ apache2.4.17 \ bin \ openssl.exe”
我在OpenSSL 1.0.2中推测其PEM_SealInit
或SSL_CONF_cmd_argv
;或者来自OpenSSL 1.1.0的ASN1_i2d_fp
或SSL_SESSION_set1_id_context
。
# OpenSSL 1.1.0
$ find $PWD -type f -iname '*.num' -exec grep " 372" {} \;
ASN1_i2d_fp 372 1_1_0 EXIST::FUNCTION:STDIO
SSL_SESSION_set1_id_context 372 1_1_0 EXIST::FUNCTION:
...
# OpenSSL 1.0.2
$ find $PWD -type f -iname '*.num' -exec grep " 372" {} \;
PEM_SealInit 372 EXIST::FUNCTION:RSA
SSL_CONF_cmd_argv 372 EXIST::FUNCTION:
...
您需要使用dumpbin
或Dependency Walker进行验证。另请参阅Stack Overflow上的How can I find the exported function name from ordinal (export by ordinal)?。
使用<openssl src>\util\mkdef.pl
创建序数。您可以从OpenSSL的GitHub存在中看到源代码。 Here is 1.0.2和here is 1.1.0。
以下是该文件的主要评论:
#!/usr/local/bin/perl -w
#
# generate a .def file
#
# It does this by parsing the header files and looking for the
# prototyped functions: it then prunes the output.
#
# Intermediary files are created, call libcrypto.num and libssl.num,
# The format of these files is:
#
# routine-name nnnn vers info
#
# The "nnnn" and "vers" fields are the numeric id and version for the symbol
# respectively. The "info" part is actually a colon-separated string of fields
# with the following meaning:
#
# existence:platform:kind:algorithms
#
# - "existence" can be "EXIST" or "NOEXIST" depending on if the symbol is
# found somewhere in the source,
# - "platforms" is empty if it exists on all platforms, otherwise it contains
# comma-separated list of the platform, just as they are if the symbol exists
# for those platforms, or prepended with a "!" if not. This helps resolve
# symbol name variants for platforms where the names are too long for the
# compiler or linker, or if the systems is case insensitive and there is a
# clash, or the symbol is implemented differently (see
# EXPORT_VAR_AS_FUNCTION). This script assumes renaming of symbols is found
# in the file crypto/symhacks.h.
# The semantics for the platforms is that every item is checked against the
# environment. For the negative items ("!FOO"), if any of them is false
# (i.e. "FOO" is true) in the environment, the corresponding symbol can't be
# used. For the positive itms, if all of them are false in the environment,
# the corresponding symbol can't be used. Any combination of positive and
# negative items are possible, and of course leave room for some redundancy.
# - "kind" is "FUNCTION" or "VARIABLE". The meaning of that is obvious.
# - "algorithms" is a comma-separated list of algorithm names. This helps
# exclude symbols that are part of an algorithm that some user wants to
# exclude.
答案 2 :(得分:1)
我刚遇到同样的问题,在Windows上使用xampp而不是Wamp。
执行此页面评论中描述的内容解决了这个问题:PHP cURL Installation。
我将3个.dll
文件从PHP安装目录复制到apache/bin
目录并重新启动了xampp。