6

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 ?

krazitchek
  • 228
  • 3
  • 10

2 Answers2

8

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.

Obsidian Age
  • 41,205
  • 10
  • 48
  • 71
phpdan
  • 81
  • 2
3

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
GAD3R
  • 4,317
  • 1
  • 23
  • 34
  • 1
    I tried but it change nothing. Installing libcurl4-gnutls-dev remove libcurl4-openssl-dev. Files requested by php are installed (easy.h) but not in the path expected. It's "new", until 7.1.2 i used to compile every new php version that way and it works every time. But this time i can't compile PHP because of path not matching by requirements. – krazitchek Feb 18 '17 at 17:32
  • @krazitchek try it with `./configure --prefix=/usr` – GAD3R Feb 18 '17 at 17:44
  • 1
    Nothing change, same error. I'm not sure but i think something change in libcurl4-openssl-dev package in debian 8 jessie (https://packages.debian.org/fr/jessie/amd64/libcurl4-openssl-dev/filelist) and debian 9 stretch (https://packages.debian.org/fr/stretch/amd64/libcurl4-openssl-dev/filelist). We can see on those two urls that path is not the same for the same package. Jessie version match requirement (/usr/include/curl/easy.h) while stretch version don't match requirement (/usr/include/x86_64-linux-gnu/curl/easy.h). – krazitchek Feb 18 '17 at 18:54