PDA

View Full Version : Call to undefined function: curl_init().


tomfmason
09-03-2006, 04:55 PM
I am running php 5.0.5 on windows XP. I have uncommented the php_curl.dll.

The manual is rather vague on the setup of curl. I read somewhere that I had to add the libeay.dll and the ssleay.dll to the system32 directory. I tried that and I am still getting the error


Call to undefined function: curl_init().



Then I tried dl("php_curl.dll"); and I got the following error



Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_curl.dll in your php.ini




Here is my simple script


<?php
dl("php_curl.dll");// this I just recently added
$url = "http://www.whois.net/whois.cgi2";
$domain = $_GET['domain'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "?d=$domain");
$result = curl_exec($ch);
echo $result;
?>

Any suggestions as to how I can get the curl working correctly would be greatly appreciated.

Thanks,
Tom

Mwnciau
09-03-2006, 05:23 PM
ini_set('extension', 'php_curl.dll');

(just a guess from the error)

tomfmason
09-03-2006, 05:57 PM
Thanks for the reply. I tried that and I am still getting the error



Fatal error: Call to undefined function: curl_init()



I used the following.


ini_set('extension', 'php_curl.dll');



Any suggestions on setting up curl to work( in a windows enviroment) without having to call ini_set or dl?

Thanks again,
Tom