【问题标题】:Compile PHP with cURL fail使用 cURL 编译 PHP 失败
【发布时间】:2016-10-05 22:38:36
【问题描述】:

我在 Ubuntu 上手动编译 PHP (7.0.7) 和 cURL (7.49.1)。 PHP编译时出现如下错误:

checking for cURL support... yes
checking for cURL 7.10.5 or greater... libcurl 7.49.1
checking for SSL support in libcurl... yes
checking how to run the C preprocessor... cc -E
checking for openssl support in libcurl... no
checking for gnutls support in libcurl... no
checking for curl_easy_perform in -lcurl... no
configure: error: There is something wrong. Please check config.log for more information.

卷曲配置:

./configure --prefix="${INSTALL_PATH}/curl"              \
            --with-openssl="${INSTALL_PATH}/openssl/"

PHP 配置

./configure --prefix="${INSTALL_PATH}/php"              \
                --with-apxs2="${INSTALL_PATH}/httpd/bin/apxs"   \
                --with-libxml-dir="${INSTALL_PATH}/libxml2"     \
                --with-gettext                                  \
                ${openldap_lib_option}                  \
                --with-openssl="${INSTALL_PATH}/openssl/" \
                --with-curl="${INSTALL_PATH}/curl/"

感谢任何输入。我需要额外的包裹吗? 如果在没有 cURL 支持的情况下编译 PHP,一切都很好。

完整的 config.log 文件是 here。 config.log 中有一堆 OpenSSL 的“未定义引用”。但我不认为它们是错误的原因,因为 gnutls 测试和 libcurl 的 openssl 测试也会发生相同的“未定义引用”。但这很奇怪,因为我在包中添加了 OpenSSL (1.0.2g) 但仍然看到“正在检查 libcurl 中的 openssl 支持...否”..

我现在使用 Ubuntu 12.04 amd64 编译。但很快也会使用 14.04/16.04 x86/amd64 编译。

【问题讨论】:

  • config.log 中有什么内容?
  • 它是关于哪个版本的 Ubuntu?像 Ubuntu 14.04 - amd64 等 -
  • @Kund 哦,我从来不知道 Ubuntu 版本很重要。是因为编译器吗?因为我没有使用任何操作系统包,所以我自己构建了所有包......我现在正在 Ubuntu 12.04 amd64 上构建它。但我还需要尽快在 Ubuntu 14.04/16.04 x86/amd64 上构建它。

标签: php linux curl compilation


【解决方案1】:

我刚刚在支持 curl 和 openssl 的 Debian 8 上编译了 PHP 7.0.8。

这里是我为避免编译错误而安装的依赖项:

apt-get install libssl-dev libcurl4-openssl-dev pkg-config

另外,我在本节中的 ./configure 选项是下一个:

--with-libdir=lib/x86_64-linux-gnu \
--with-openssl=/usr \
--with-curl \

这里是 bugs.php.net 上的相关主题:

https://bugs.php.net/bug.php?id=69510

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-11
    • 2021-10-07
    相关资源
    最近更新 更多