Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling php with curl, where is curl installed?

I need to specify a directory when compiling php with --with-curl=

The curl binary is located at /usr/bin/curl

curl -V gives me

curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 

locate curl gives me

/usr/bin/curl /usr/lib/libcurl.so.3 /usr/lib/libcurl.so.3.0.0 /usr/lib64/libcurl.so.3 /usr/lib64/libcurl.so.3.0.0 

removed /usr/share/... and other irrelevant files

UPDATE

Tried --with-curl=/usr/lib64 and --with-curl=/usr/lib although I'm pretty sure it's 64 bit.

checking for cURL support... yes checking if we should use cURL for url streams... no checking for cURL in default path... not found configure: error: Please reinstall the libcurl distribution -     easy.h should be in <curl-dir>/include/curl/ 

SOLUTION

PHP requires curl-devel

like image 566
HyderA Avatar asked Feb 12 '11 07:02

HyderA


People also ask

Where is curl installed?

Inside the src folder you will find the curl executable file. At this point, you need to copy the executable file and paste it inside a local folder on your PC to be able to run the curl.

How do you check php-curl installed or not?

php // Script to test if the CURL extension is installed on this server // Define function to test function _is_curl_installed() { if (in_array ('curl', get_loaded_extensions())) { return true; } else { return false; } } // Ouput text to user based on test if (_is_curl_installed()) { echo "cURL is <span style=\"color: ...

Is curl installed by default?

Windows 10, version 1803 or laterIf you have version 1803 or later of Windows 10, cURL is installed by default. To try it out, see Testing your cURL installation below.


1 Answers

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).

like image 61
netcoder Avatar answered Sep 20 '22 15:09

netcoder