Call to undefined function curl_init() [duplicate]
Asked Answered
J

2

7

Possible Duplicate:
curl_init() function not working

I am using PHP for accessing the Foursquare API. I have set up everything for the authentication with Foursquare. But as soon as I click on the "Allow" button, my callback.php gives me the following error:

Fatal error: Call to undefined function curl_init() in C:\wamp\www\EpiFoursquare.php on line 119

Call Stack

Time    Memory  Function                          Location
0.0007  372592  {main}( )                         ..\callback.php:0
0.0039  571896  EpiFoursquare->getAccessToken( )  ..\callback.php:17
0.0040  572928  EpiFoursquare->request( )         ..\EpiFoursquare.php:31

Where does this error come from? I cannot find the origin. Please help me out.

Joanne answered 19/4, 2012 at 11:23 Comment(5)
The issue has nothing to do with foursquare at all. Turn on curl module in php. "I just dont know, why it is originating." --- why don't you read error message then?!Tinney
sir actually I am getting this error, it say "Fatal error: Call to undefined function curl_init() in C:\wamp\www\EpiFoursquare.php on line 119" and all the necessary files are placed in the folder, like callback.php, index.php, EpiCurl.phpJoanne
curl is a php extension nz.php.net/manual/en/curl.installation.phpTinney
I am connected to 4square web site, on callback, it must f=give me the access token. but when I echo $token["access_token"], it is empty.Joanne
any one please help me out. error is actually "Fatal error: Uncaught exception 'EpiFoursquareBadRequestException' with message '{"error":"redirect_uri_mismatch"}' in /home/apmtpuci/public_html/4square/EpiFoursquare.php:244 Stack trace: #0 /home/apmtpuci/public_html/4square/EpiFoursquare.php(208): EpiFoursquareException::raise(Object(EpiCurlManager), false) #1"Joanne
T
12

You need to initialize the cURL extension: http://php.net/manual/en/curl.installation.php

Tinney answered 19/4, 2012 at 11:54 Comment(1)
I did this by enabling the php_curl.dll extension in the php.ini file (as FlatLander also mentions). Since I use WAMP Server, I did not need to do anything else, as the ssleay32.dll, libeay32.dll, and php_curl.dll files are already in the right places inside my C:\wamp\ directory.Gyno
P
9
  1. remove ; from extension=php_curl.dll in php.ini ;
  2. ensure that ssleay32.dll and libeay32.dll are in Windows/system32 ;
  3. copy php_curl.dll into Windows\System32 as well.

This worked for me!

Permatron answered 25/9, 2012 at 0:23 Comment(1)
I tried this but it did not work for me. I am not sure if thing have been updated in the last few years. I am using PHP 5.6.13. As above I had to remove ; from extension=php_curl.dll in php.ini, I also had to remove ; from extension_dir = "ext" in php.ini.Levitus

© 2022 - 2024 — McMap. All rights reserved.