Viewed   184 times

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


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


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/


PHP requires curl-devel



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

Saturday, November 19, 2022

you should check examples from here

Bellow is the code for you case,

$url = "http://build:[email protected]:8080/job/android-test/buildWithParameters";     
$data = "POST_RESULTS=true&RUN_ID=".$testrun_id."&CHECK_NAME=SampleAutomatedPlan";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 

// $output contains the output string
$output = curl_exec($ch);

// close curl resource to free up system resources
Saturday, October 15, 2022
$fields = 2;
$fields_as_string = "key=value&key2=value"    

//open the curl connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
// set the number of post fields
curl_setopt($ch,CURLOPT_POST, $fields);
// set the fields
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_as_string);

//execute post
$result = curl_exec($ch);

//close connection

Don't forget to make sure you've enabled the curl php extension.

Tuesday, August 30, 2022

AFAIR, you need libeay32.dll and libssl32.dll files on PATH for Curl to work properly. And probably 64 bit for your x64 system.

Monday, October 17, 2022

You can create curl.lib using implib. Implib is in the Basic Utilities download.

Run it against your curllib.dll in /libcurl-7.19.3-win32-ssl-msvc/lib/Release/ like this:

implib /s curl.lib curllib.dll

Then put curl.lib where dmd can find it and compile. Unfortunately, you'll probably still get an error about a missing libsasl.dll when you run your program. You may be able to use a binary from Shining Light Productions, build it with MSVC from the OpenSSL source, or hunt it down online.

There's still a possibility you'll have trouble with conflicting versions. If you browse the etc.c.curl source, you'll notice it lists its cURL version as 7.21.4, which doesn't match any of the Windows binaries available. If you want something very reliable, you may have to wait for the next D cURL module or build everything yourself.

Sunday, December 4, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :