Joshua's Thoughts

how to enable libcurl in wamp

Tags: , , ,

if you’re getting “Fatal error: Call to undefined function: curl_init()” and you’re using wamp, you’ve got to perform a few extra steps to get curl working.

wamp comes with a crap load of extensions, including curl. it’s just a matter of getting the extension loaded when wamp is started. and no, enabling php_curl from within the wamp menu is not how to do it. for some reason, that just doesn’t work.

here’s what you need to do:

  • open C:\wamp\bin\php\php5.2.6\php.ini
  • find “;extension=php_curl.dll” and remove the semicolon to uncomment the line
  • do the same for C:\wamp\bin\apache\apache2.2.8\bin\php.ini

it doesn’t matter what version of wamp you’re running at the time, the process is the same.

next, you need to make sure apache can find the extension to load, so make sure that in both php.ini files, you find the lines:

; Directory in which the loadable extensions (modules) reside.
extension_dir = “C:\wamp\bin\php\php5.2.6\ext”

… and have them both point to the ext folder within your PHP folder. by default, they will be something like /usr/bin/ext. change that.

restart wamp and it should all work. you can look in the phpinfo to see if curl was loaded. if it still doesn’t work, check the apache error log within the wamp logs folder.

3 Comments, Comment or Ping

  1. Thanks! It really helps!

  2. akm1313

    Thanks! … works a charm

  3. Thanks! WAMP was using curl just fine, but I was having trouble getting the NetBeans IDE’s PHPUnit support working with curl. Uncommenting the appropriate line in php.ini did the trick.

Reply to “how to enable libcurl in wamp”