【问题标题】:"OpenSSL version is too old" while compiling http 2.4.16 on MacOS 10.11在 MacOS 10.11 上编译 http 2.4.16 时出现“OpenSSL 版本太旧”
【发布时间】:2015-12-19 13:03:01
【问题描述】:

我在 El Capitan 10.11.1 上编译 http 2.4.16 时遇到 OpenSSL 错误。

它正在寻找 OpenSSL 版本 >= 0.9.8a

checking for OpenSSL... checking for user-provided OpenSSL base directory... none
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old

默认的 OpenSSL 版本是 0.9.8zg

$ openssl version
OpenSSL 0.9.8zg 14 July 2015

最后这是我的编译行的一部分:

./configure --prefix=/usr/local/MyWebserver/httpd-2.4.12 \
--enable-ssl \
--with-few-things… \
--disable-lots-of-things…

即使使用 brew,我也不想安装另一个 openssl。

【问题讨论】:

  • 当我在配置文件的第 24800 行修复变量 ac_cv_openssl=yes 时,配置命令起作用。但随后在制作过程中发生错误:fatal error: 'openssl/rsa.h' file not found
  • 编译工作在 10.9 和 10.10 上,尽管 openssl 版本是相同的,所以我猜新系统有一些不同...

标签: apache openssl osx-elcapitan


【解决方案1】:

对我来说,通过安装包“openssl-devel”解决了这个问题。

【讨论】:

    【解决方案2】:

    以上解决方案都不适合我。

    我通过告诉“配置”使用哪个 open-ssl 来解决它:

    在做./configure时,请添加以下内容:

    --with-ssl=/usr/local/Cellar/openssl/1.0.2r

    而 1.0.2r 是您当前的 openssl 版本,通常由 brew 安装。

    我更喜欢使用这种方法而不是弄乱系统文件(即不喜欢链接 /usr/... 目录上的任何内容,因为它会弄乱系统,尤其是 Apple 总是会进行更新以防止你这样做),因此,以下命令有效:

    ./configure --enable-ssl --enable-so --prefix=/(随便你 安装位置) --with-included-apr --with-mpm=prefork --with-ssl=/usr/local/Cellar/openssl/1.0.2r

    为了使我的安装工作,我还需要下载 apr 和 apr-util,在安装前解压缩并将它们放在 srclib 文件夹中。

    我希望这会有所帮助。

    【讨论】:

    • 不错。像魅力一样工作。但是make命令说no targets,当然跟openssl没有关系
    【解决方案3】:

    如果您安装了当前版本的 OpenSSL(使用 Homebrew),则不一定需要复制内容,创建一个符号链接就足以确保它被 configure 命令拾取:

    ln -s /usr/local/opt/openssl/include/openssl /usr/local/include
    

    更多详情:https://medium.com/@timmykko/using-openssl-library-with-macos-sierra-7807cfd47892

    【讨论】:

      【解决方案4】:

      我找到了办法:

      1. 将文件夹 /usr/incude/openssl 从 Yosemite (MacOS 10.10) 复制到我的计算机 (El Capitan MacOS 10.11) 上的 /usr/local/include/openssl。
      2. 然后通过在编译环境变量 gcc 和 g++ 中添加标志来编译 apache:-I/usr/local/include

      这是我使用的所有变量:

      ARCH="-arch x86_64 -mmacosx-version-min=10.7"
      LDFLAGS="-O3 $ARCH"
      CFLAGS="-O3 -fno-common $ARCH"
      CXXFLAGS="-O3 -fno-common $ARCH"
      CC="gcc $ARCH -I/usr/local/include"
      CXX="gcc $ARCH -I/usr/local/include"
      CPP="gcc -E"
      CXXCPP="g++ -E »
      

      【讨论】:

        【解决方案5】:

        实际上,您只需要提供标题即可。 下载Openssl源码here,然后复制到/usr/local/include/如下,

        $ sudo cp -r include/openssl /usr/local/include/
        

        那么一切都会好起来的。

        【讨论】:

        • 我无法将它复制到 /usr/lcal/include,因为我正在编译一个本身包含 Web 服务器的应用程序(例如,几乎像 MAMP)
        猜你喜欢
        • 2016-04-09
        • 1970-01-01
        • 2020-10-21
        • 2020-07-23
        • 1970-01-01
        • 2021-05-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多