Compiling php with curl, where is curl installed?
Solution 1:
None of these will allow you to compile PHP with cURL enabled.
In order to compile with cURL, you need libcurl header files (.h files). They are usually found in /usr/include/curl
. They generally are bundled in a separate development package.
Per example, to install libcurl in Ubuntu:
sudo apt-get install libcurl4-gnutls-dev
Or CentOS:
sudo yum install curl-devel
Then you can just do:
./configure --with-curl # other options...
If you compile cURL manually, you can specify the path to the files without the lib
or include
suffix. (e.g.: /usr/local
if cURL headers are in /usr/local/include/curl
).
Solution 2:
For Ubuntu 17.0 +
Adding to @netcoder answer above, If you are using Ubuntu 17+, installing libcurl header files is half of the solution. The installation path in ubuntu 17.0+ is different than the installation path in older Ubuntu version. After installing libcurl, you will still get the "cURL not found" error. You need to perform one extra step (as suggested by @minhajul in the OP comment section).
Add a symlink in /usr/include of the cURL installation folder (cURL installation path in Ubuntu 17.0.4 is /usr/include/x86_64-linux-gnu/curl).
My server was running Ubuntu 17.0.4, the commands to enable cURL support were
sudo apt-get install libcurl4-gnutls-dev
Then create a link to cURL installation
cd /usr/include
sudo ln -s x86_64-linux-gnu/curl