View Single Post
  #1 (permalink)  
Old 11-01-09, 02:49 AM
hemi hemi is offline
Wannabe Coder
 
Join Date: Aug 2009
Posts: 117
Thanks: 15
Thanked 0 Times in 0 Posts
curl_init() not working

iam getting error for both the scripts

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://google.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>

whn iam using this script iam getting an error

Call to undefined function curl_init() in C:\wamp\www\pdf\text.php on line 2

---------------------------------------------------------------------------------------


<?php
$file_contents = file_get_contents('http://example.com/');

// display file
echo $file_contents;
?>

----------------------------------------------------------
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\pdf\text.php on line 2

Warning: file_get_contents(Example Web Page) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\pdf\text.php on line 2
-------------------------------------------------------------


allow_url_fopen is "on" in my phpinfo()

allow_url_include is "off" in my phpinfo()


or if u have any other that scripts tht works plz let me know
Reply With Quote