Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 7.1.2 compilation and libcurl error

PHP 7.1.2 is here, i tried to compile it as usually but this time ./configure fail with these error:

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/

I'm on Debian Stretch (9).

I found libcurl4-openssl-dev is installed in /usr/include/x86_64-linux-gnu/curlwhen./configureexpect it in/include/curl/`

libcurl4-openssl-dev on debian Jessie install curl in /usr/include/curl/ when Stretch install curl in /usr/include/x86_64-linux-gnu/curl.

With the last PHP version I compiled (7.1.1), I had no problems, but this time it failed.

To compile:

./buildconf --force && ./configure --prefix=/usr/local/php --with-config-file-path=/etc/php/lib --enable-bcmath --with-bz2 --with-zlib --enable-zip --enable-calendar --enable-exif --enable-ftp --with-gettext --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xpm-dir --enable-mbstring --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-intl --enable-soap --with-readline --with-curl --with-mcrypt --with-xsl --enable-sockets

curl and libcurl4-openssl-dev packages are installed

I tried with --with-curl=/usr/include/x86_64-linux-gnu/curl/ but it doesn't work.

I don't know how to solve this, can someone knows please ?

like image 550
krazitchek Avatar asked Feb 17 '17 14:02

krazitchek


2 Answers

A temporary solution is to create a sym link at /usr/local/include/curl pointing to /usr/include/x86_64-linux-gnu/curl and to compile PHP with --with-curl=/usr/local.

Example: command from within /usr/local/include as user root or using sudo ln -s /usr/include/x86_64-linux-gnu/curl curl.

For others searching this problem, replace x86_64 with your architecture.

I can not tell you if it is a bug, or unintended consequence of updates to the libcurl4-gnutls-dev and libcurl4-openssl-dev packages. You will notice that if you try to compile the previous versions of PHP, they now will also fail with the missing curl error, because simply, the new development packages do not create the required files where PHP expects them.

I call it a temporary solution as future updates in Debian may fix this by placing a symlink or something at /usr/include/curl pointing to your default architecture, or maybe the PHP configure script will get updated. The reason you use --with-curl=/usr/local is that the PHP configuration script wants "what you specify", and appends /include/curl.

like image 180
phpdan Avatar answered Nov 05 '22 00:11

phpdan


You should install the libcurl4-gnutls-dev package.

This package provides the development files (ie. includes, static library, manual pages) that allow one to build software which uses libcurl.

To install libcurl4-gnutls-dev :

sudo apt-get install libcurl4-gnutls-dev
like image 26
GAD3R Avatar answered Nov 05 '22 02:11

GAD3R