Asked  7 Months ago    Answers:  5   Viewed   52 times

I have followed all the instructions here:

to install & config apache get the PHP5 packages and get the CURL packages.

I run the apache and run a PHP script. no problem. but when I run the php script with curl, it fails.

It returns: **Call to undefined function curl_version() in C:Program FilesApache Software FoundationApache2.2htdocstesting.php on line 5**

In which line 5 is a called to curl_init()

I output the php -i to see whether the right path to extension is called. It is correctly set:

extension_dir => C:PHPext => C:PHPext
cURL support => enabled
cURL Information => libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3

I even tried to run curl_version() but still, same kind of error comes up.
It looks like the PHP can't find the CURL extension, but the php.ini (and also php -i) shows that it is set.

any idea? :)

P.S>  System I m running on:
Windows XP
Apache 2.2
PHP 5.2.6
CURL Win32 Generic Binaries: Win32 2000/XP  metalink    7.19.0  binary  SSL enabled     Daniel Stenberg     249 KB

I didn't get this:

Win32 2000/XP   7.19.0  libcurl     SSL enabled     Günter Knauf    1.55 MB
Should I get this one instead?

The reason I need to use CURL is that it is the requirement from my project. So, I can only stick with that. XAMPP... how does it work in Windows? Is there any site that you can recommend? Thanks.

I have tried a lot of things on installing cURL and check everything, but still, I'm stilling circling around the problem and have no idea what's going on.

The Apache server uses the right PHP.ini. and the PHP.ini has the correct extension_dir and extension=php_curl.dll I have no idea why it doesn't work. even I follow every step for setting it up. :(



You're probably mistaking what PHP.ini you need to edit. first, add a PHPinfo(); to a info.php, and run it from your browser.

Write down the PHP ini directory path you see in the variables list now! You will probably notice that it's different from your PHP-CLI ini file.

Enable the extension

You're done :-)

Wednesday, March 31, 2021
answered 7 Months ago

you should check examples from here

Bellow is the code for you case,

$url = "";     
$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
Wednesday, March 31, 2021
answered 7 Months ago


CURLOPT_STDERR must be set to something specific.

Setting curl_setopt($c, CURLOPT_STDERR, fopen('/curl.txt', 'w+')); fixed my issue.

As it turns out curl_setopt($c, CURLOPT_VERBOSE, 1); is not printing the output to STDERR for some reason which I have not uncovered. I did not find the output in any of my PHP, Apache, nor Event Viewer logs.

After setting curl_setopt($c, CURLOPT_STDERR, fopen('/curl.txt', 'w+'));, I was able to see the output in the curl.txt file.

I am not sure if this is specific to Windows environments.

Saturday, May 29, 2021
answered 5 Months ago

If you don't already have a C/C++ development environment installed that is compatible with the Visual Studio binaries distributed by, then you should stick to installing only pure Python packages or packages for which a Windows binary is available.

Fortunately, there are PyCrypto binaries available for Windows:

As @Udi suggests in the comment below, the following command also installs pycrypto and can be used in virtualenv as well:


Notice to choose the relevant link for your setup from this list

If you're looking for builds for Python 3.5, see PyCrypto on python 3.5

Monday, June 7, 2021
answered 5 Months ago

In the Cygwin package manager, click on curl from within the "net" category. Yes, it's that simple.

Sunday, June 27, 2021
answered 4 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :