7

The PHP framework I use needs OpenSSL for various features, but when executing anything related to OpenSSL, I get the following error: "Can't find ordinal 372 in DLL-file C:\wamp64\bin\apache\apache2.4.17\bin\openssl.exe".

I don't know how to correct this at all, I looked everywhere already. I'd appreciate the help, as I don't know how to fix this.

jww
  • 97,681
  • 90
  • 411
  • 885
  • Also see [Wamp2 and “The ordinal 942 could not be located in the dynamic link library LIBEAY.dll”](http://stackoverflow.com/q/6178815/608639), [WAMPx64 / Openssl Ordinal 372 cannot be located](http://stackoverflow.com/q/38046271/608639), [Can't find ordinal 372 in WAMP/Apache's openssl.exe](http://stackoverflow.com/q/36238887/608639), [“The Ordinal 112 could not be located in dynamic link library…”](http://stackoverflow.com/q/36163468/608639), etc. – jww Feb 20 '17 at 17:21

3 Answers3

10

To fix the issue, two things are needed:

1) Make sure that you don't have symbolic links for libeay32.dll and ssleay32.dll in your Apache bin directory (For example, mine is: C:\wamp64\bin\apache\apache2.4.23\bin)

If you do have symbolic links (i.e. the file size are 0 bytes), you need to download the dlls from Apache Lounge. For example, I grabbed the two .dll files from the 64-bit version of Apache 2.4.23 hosted at https://www.apachelounge.com/download/

2) Once you have the actual .dll files restored, you need to make sure that WampServer isn't overwriting them. WampServer 3 has a configuration script that runs every time it starts. In that script it will overwrite those .dlls with symbolic links. You must DISABLE that functionality. To do so, comment out the references to those two files in: C:\wamp64\scripts\config.inc.php (mine were located at lines 133 and 139).

That should allow you to enable the mod_ssl module in Apache. You'll also need to uncomment the "Include conf/extra/httpd-ssl.conf" after you get Apache booting properly with mod_ssl enabled. (However, you'll likely need to delete most of whats in there and start over since it includes lots of hardcoded paths and bugs)

Adam Albright
  • 5,917
  • 1
  • 21
  • 14
  • Never amend the WAMPServer scripts. If its a real problem (this is not) you are trying to fix, suggest a fix at http://forum.wampserver.com/list.php?2 where it can be evaluated and merged into future updates if it is deemed a solution to a real problem – RiggsFolly Oct 13 '16 at 19:01
  • @RiggsFolly - I'd be interested in knowing... How do you claim this is not a real problem? Not only is it a real problem, its a recurring problem that surfaces on Stack Overflow. Perhaps the Winamp folks should monitor Stack overflow for trends. – jww Oct 13 '16 at 20:53
  • @RiggsFolly -- Sure, I'll report my fix to the developers. Since I spent several hours getting HTTPS working I wanted to pass along this temporary patch until the developers can fix it properly. (Can you unmark this as a duplicate since the other thread isn't a problem caused by WampServer?) Thanks! – Adam Albright Oct 15 '16 at 08:55
  • @AdamAlbright - *"Can you unmark this as a duplicate since the other thread isn't a problem caused by WampServer"* - Done, thanks. – jww Feb 20 '17 at 17:21
1

... "Can't find ordinal 372 in DLL-file C:\wamp64\bin\apache\apache2.4.17\bin\openssl.exe"

I'm speculating its PEM_SealInit or SSL_CONF_cmd_argv from OpenSSL 1.0.2; or ASN1_i2d_fp or SSL_SESSION_set1_id_context from OpenSSL 1.1.0.

# 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:
...

You will need to verify it by using dumpbin or Dependency Walker. Also see How can I find the exported function name from ordinal (export by ordinal)? on Stack Overflow.


The ordinals are created using <openssl src>\util\mkdef.pl. You can see the source code from OpenSSL's GitHub presence. Here is 1.0.2 and here is 1.1.0.

Here are the head comments for the file:

#!/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.
Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885
  • @RiggsFolly - A comment for the downvote would be helpful for future visitors. Its not clear why the answer above that shows how OpenSSL uses ordinals and identifies the problem ordinal is incorrect. – jww Oct 13 '16 at 21:00
1

I just encountered the same problem, on Windows and using xampp instead of Wamp.

Doing what's described in the commentaries of this page solved it : PHP cURL Installation.

I copied the 3 .dll files from the PHP installation directory to the apache/bin directory and rebooted xampp.

Eria
  • 2,653
  • 6
  • 29
  • 56