Home » Php » php – Call to undefined function curl_init()

php – Call to undefined function curl_init()

Posted by: admin July 12, 2020 Leave a comment

Questions:

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.

How to&Answers:

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

Answer:

  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!