【问题标题】:OpenSSL not listed under PHP modules but shows up in the configure commandOpenSSL 未在 PHP 模块下列出,但显示在配置命令中
【发布时间】:2010-04-03 04:33:53
【问题描述】:

PHP 5.2.12
OS X 10.5.8

如果我使用以下配置命令从源代码编译 PHP

./configure --disable-all --with-openssl=shared,/opt/local

成功了。但是,在makemake install 之后,

php -m

列出 openssl 模块。

根据我阅读的内容,我认为这可能是由于多次安装了 openssl 库。从源代码安装最新版本的 openssl 并尝试在 configure 命令中指定路径 --with-openssl=/usr/local,总是会导致以下错误:

Undefined symbols:
  "_EVP_CIPHER_CTX_block_size", referenced from:
      _zif_openssl_seal in openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

我在路径上尝试了几种不同的变体,但都没有成功。

基于 http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/,我也尝试过编辑 Makefile,以便 MH_BUNDLE_FLAGS 出现在编译行的后面。

在这个问题上花了大半天的时间后,我不知所措。

有什么建议吗?

理想情况下,我希望使用已编译的最新版本的 OpenSSL。但在这一点上,我愿意接受任何可行的方法。

【问题讨论】:

    标签: php macos openssl compiler-errors configure


    【解决方案1】:

    呃。当然php -m 不会列出该模块。它被指定为“共享”。是的,我对从源代码编译不是很熟悉。

    我的解决方案包括

    ./configure
    --disable-all \
    --prefix=/usr/local \
    --with-openssl=shared,/usr \
    --with-config-file-scan-dir=/etc
    ...<snip>
    

    然后添加

    extension=openssl.so
    

    /etc/php.ini

    重新启动 apache,现在一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-03
      • 1970-01-01
      • 1970-01-01
      • 2021-08-27
      相关资源
      最近更新 更多