By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,354 Members | 600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,354 IT Pros & Developers. It's quick & easy.

Problem with curl_init()

100+
P: 118
Hi,

i used the curl_init() function in my application.


Expand|Select|Wrap|Line Numbers
  1.  
  2. function exchangeToken($token) {
  3. $ch = curl_init(); /* Create a CURL handle. */
  4.  
  5. curl_setopt($ch, CURLOPT_URL,"https://www.google.com/accounts/AuthSubSessionToken");
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7. curl_setopt($ch, CURLOPT_FAILONERROR, true);
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  9. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  10. 'Authorization: AuthSub token="' . $token . '"'
  11. ));
  12.  
  13. $result = curl_exec($ch); /* Execute the HTTP command. */
  14. curl_close($ch);
  15.  
  16. $splitStr = split("=", $result);
  17. return trim($splitStr[1]);
  18. }
  19.  
  20.  
i used like that i got the errors as

Fatal error: Call to undefined function: curl_init() in F:\contact\demo.php on line 80

and i remove the semicolon before extension=php-curl.dll(php.ini) and i got the another error as

Fatal error: Call to undefined function: curl_init() in F:\contact\demo.php on line 80
PHP Warning: Unknown(): Unable to load dynamic library './php_curl.dll' - The specified module could not be found. in Unknown on line 0

And i am using php 4 version

Please suggest how can i resolve my problem.
Jan 7 '09 #1
Share this Question
Share on Google+
1 Reply

10K+
P: 13,262
You need to have libcurl installed first.
Jan 7 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.