2
votes

I have WAMP and I am running PHP 5.3.13 with Apache 2.2.22.

I have enabled the extension by ticking php_curl. I have restarted my computer.

My code is saying:

Fatal error: Call to undefined function curl_init() 

Anyone think what might be going wrong?

My phpinfo does not say anything about curl but in the phpini it says:

;extension=php_bz2.dll

extension=php_curl.dll .

Code calling it is here:

class ***** {
  public static $oauth, $debug, $logger, $session_manager, $last_response;
  protected static $url, $client_id, $client_secret, $secret, $ch, $headers;

  const GET = 'GET';
  const POST = 'POST';
  const PUT = 'PUT';
  const DELETE = 'DELETE';

  public static function setup($client_id, $client_secret, $options = array('session_manager' => '*****Session')) {
  // Setup client info
  self::$client_id = $client_id;
  self::$client_secret = $client_secret;

  // Setup curl
  self::$url = empty($options['api_url']) ? 'https://api.*****.com:443' : $options['api_url'];
  self::$debug = false;
  self::$ch = curl_init();

This code comes from a trustworthy API. I have starred words that need not be shared.

3
Then you don't actually have it enabled. Refer to the documentation on how to enable it. - Jan Hančič
this doesn't help. I have come here because I have referred to the documentation - Jimmyt1988
What have you did so far, Put up the code. - user-457786
added to Q - its an api that has worked on old wamp installation but not this one. I'm on windows 8 if that's any help - Jimmyt1988
;extension=php_bz2.dll extension=php_curl.dll in the same line? Try putting extension=php_curl.dll in its own line - ori

3 Answers

4
votes

Replace the dll file found in ext folder with the correct version here:

http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/

I am using win 8 64bit so the version for me was:

http://www.mediafire.com/?0hm40owj08y68p7

1
votes

Look in your php.ini file for this line:

;extension=php_curl.dll

If its there, delete the ; from the beginning then restart the server and try again.

0
votes

Are you by chance using the 64bit edition of wampserver?

There's an issue (it seems) with either the 64bit edition, or certain combinations of Apache versions / PHP versions

If you go to the download section of the wampserver homepage you can download different Apache / PHP version to test until you find one that works.

I have answered this kind of question before here. Hope it can shed some light on the situation.

From my other answer:

I ran into this issue myself a couple of days ago, the only way I could fix it is by installing apache addon version 2.2.9 and php addon version 5.3.1