Compile PHP with cURL fail

2019-07-29 22:57发布

I am manually compiling PHP (7.0.7) and cURL (7.49.1) on Ubuntu. The following error is seen during PHP compilation:

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.

Curl configuration:

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

PHP configuration

./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/"

Appreciate any input. Do I need to get any extra package? If compile PHP without cURL support, everything is fine.

The full config.log file is here. There is a bunch of "undefined reference" of OpenSSL stuff in the config.log. But I don't think they are the cause of the error as the same "undefined reference" happens for gnutls test and openssl test of libcurl as well. But it is a strange though as I have added OpenSSL (1.0.2g) in the package but still seeing "checking for openssl support in libcurl... no"..

I am using Ubuntu 12.04 amd64 to compile now. But soon will use 14.04/16.04 x86/amd64 to compile as well.

1条回答
Deceive 欺骗
2楼-- · 2019-07-29 23:52

I just compiled PHP 7.0.8 on Debian 8 with curl and openssl support.

And here are dependencies which i installed to avoid compilation errors:

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

Plus, my ./configure options in this section are next:

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

Here is related topic on bugs.php.net:

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

Hope this helps

查看更多
登录 后发表回答