Compile PHP with cURL fail

若如初见. 提交于 2019-12-13 17:27:34

问题


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:


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



来源:https://stackoverflow.com/questions/37655433/compile-php-with-curl-fail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!