There appear to be a lot of misguided people on the intarwebs claiming all sorts of varying things you have to do to get CURL to work on a Windows-based XAMPP install. I’d like to clear them all up here and now.
Using CURL in XAMPP
It’s really quite simple - uncomment extension=php_curl.dll in your php.ini file, then restart Apache1.
A lot of confusion seems to stem from the fact that there are multiple php.ini files in a standard XAMPP install. This really isn’t as confusing as you’d think it would be, assuming you - and I know I’m going out on a limb here - read the documentation.
There’s a straight-forward XAMPP FAQ Entry about their php.ini stucture. For those looking for the easy fix, ignore everything but the /apache/bin/php.ini file. That’s the only one that counts, regardless of which PHP version you’re currently using.
What about all the .dll files you need? Well, you don’t need them. Everything you need to run CURL on a XAMPP install is included in the download. Stop downloading extra crap and sticking it all over your system. XAMPP knows what it needs, where it’s at, and how to use it. End of story.
This is all based on the XAMPP Basic Package for Windows, version 1.6.1, released on 4/18/2007. YMMV.
- Restarting Apache is required on both Windows and Linux whenever you make configuration changes. ↩
37 Comments so far
Dave Bowker, on April 29, 2007 at 6:05pm, said:
Many many thanks for this post. I’m currently redesigning my site and needed to use Curl locally. Great post!
Edit Comment
Frank, on May 1, 2007 at 3:04am, said:
Nice post mate! Worked a treat for me, just when I was about to start downloading .dlls and uncommenting configuration directives all over the show :) Thanks!
Edit Comment
Folkert, on May 1, 2007 at 1:25pm, said:
Thanks a lot for popping up high in google with this post, saves me and i thinks lot’s of others. Url is to a post with sort of the same info.
Thanks.
Edit Comment
Sam Potts, on May 31, 2007 at 4:01pm, said:
That works perfect! Even on “lite”. I’d read about having to configure 6 files elsewhere but remove the semi colon and you’re away.
Cheers
Sam
Edit Comment
MyGreyGoose, on June 18, 2007 at 1:08pm, said:
Thank You! That simplified what I couldn’t find anywhere else without pages of complicated instructions. Save me tons of time!
Edit Comment
Russ Timo, on September 4, 2007 at 9:52pm, said:
I have spent 2 days googling around untill I found this site. Man, this is perfect fit! many thanks.
Edit Comment
Edgar Santos, on September 14, 2007 at 1:38pm, said:
Thanks… I google this but there is a lot of wrong information about this topic.
Edit Comment
Barlow Tucker, on December 25, 2007 at 6:52pm, said:
Thanks for the help! Worked great! Sounds like I am lucky to have found this page first :)
Edit Comment
norm, on January 7, 2008 at 8:12am, said:
** SIMPLY RESTARTING APACHE MAY NOT BE ALL THATS NEEDED **
I had to reboot Windows to get mine to take. - Beat my head against the wall for 2-3 hours on that before tossing in the towel and giving the machine the three-finger salute.
Edit Comment
Aveesh Kumar, on February 21, 2008 at 1:46am, said:
Thanks a lot for the simple solution. Am sooo very glad you came high on the google pagerank when i searched “PHP curl XAMPP”…cheers
Cheers…
Edit Comment
Binu Jayaraj, on March 5, 2008 at 8:01pm, said:
Million thanks.
Edit Comment
Xaratos, on April 10, 2008 at 1:24am, said:
Thank you a lot (from Italy)
Edit Comment
Dave, on April 14, 2008 at 3:44am, said:
Saved me a lot of bother! Many thanks.
Edit Comment
Internia, on April 14, 2008 at 11:57pm, said:
Simply and clear, thanx a lot, great post
Edit Comment
Mouly, on April 15, 2008 at 2:16pm, said:
Thanks for the solution
Edit Comment
Mike, on April 25, 2008 at 1:41am, said:
This is pure awesome. Many thanks for helping me fix curl with my xampp install. I was getting a fatal error with curl_init()
Edit Comment
Ivan, on April 27, 2008 at 7:07pm, said:
Thanks very much…it was actually very simple :)
Edit Comment
ajai, on May 2, 2008 at 1:34pm, said:
Thanks alot. Worked like a charm
Edit Comment
judotens, on May 2, 2008 at 5:47pm, said:
it doensn’t work on my xammp =((
please help me brothers..
Fatal error: Call to undefined function curl_init() in D:\xampp\htdocs\test\tes.php on line 9
Edit Comment
Bruce, on May 9, 2008 at 8:23am, said:
Thanks from me too!! Just got back into working on my site and I don’t really care about learning about all the inside programming and services so your simple fix got me past this hurdle and frustration. :-)
Edit Comment
Chakri, on May 13, 2008 at 3:49pm, said:
Thank you for clearing that up. That helped me!!!
Edit Comment
Editing PHP.ini in XAMPP | Mike DelGaudio, on May 21, 2008 at 6:23am, said:
[…] I do a fair amount of development work on my laptop using XAMPP. I must admint that I have not read the documentation as thoroughly as I should, so I was very pleased when I found Chris Meller’s post on turning on CURL for XAMPP. […]
Edit Comment
Mike W, on September 2, 2008 at 1:43am, said:
Thanks man! Very helpful indeed! :)
Edit Comment
Vickie B, on September 3, 2008 at 7:04pm, said:
After toying with this for an hour and a half I stumbled upon your post. It took all of 45 seconds to get it running and get my local script to behave. You’re a gentleman and a scholar. Thank you.
Edit Comment
Savage, on September 19, 2008 at 3:50am, said:
Had to change the php5.ini in my php directory aswell, but it worked like a charm.
Thanks
Edit Comment
Chris Meller, on September 19, 2008 at 3:55am, said:
The other PHP INI files XAMPP uses are only “templates” that it uses when you switch between versions (since XAMPP still bundles PHP4 as well). Unless you were switching between 4 and 5, you shouldn’t need to edit anything additional.
Edit Comment
Son, on September 25, 2008 at 11:29pm, said:
Thanks, works well for me. Very simple
Edit Comment
leo, on October 23, 2008 at 5:56am, said:
thx man
Edit Comment
Rick, on November 5, 2008 at 1:11pm, said:
Somewhat lame question but once you know cURL is working on phpinfo(), how do you actually go about using/running it?
Edit Comment
Tetley, on November 28, 2008 at 1:34pm, said:
I’ve tried this on two separate machines and it hasn’t worked. I work in IT and I’ve followed the instructions exactly, as well as other ideas from other sites. Machine rebooted and everything. When I do php info all the directorys point to the correct files. Any ideas would be welcomed.
Cheers.
Edit Comment
Anze, on December 17, 2008 at 6:32am, said:
Thank you very much, this worked like a charm! :)
And now I finally know in what php.ini to set up my SMTP server as well … :)
Edit Comment
James, on January 5, 2009 at 1:51pm, said:
Thanks for confirming this for me, cheers.
Edit Comment
eric, on January 8, 2009 at 12:23am, said:
thanks for putting it straight!
Edit Comment
Juni, on January 15, 2009 at 6:29am, said:
Thanx a lot for such a nice and clear description.
Great help..
Edit Comment
Gary, on January 16, 2009 at 7:12am, said:
What they said!!
Awesome Dude!!
Edit Comment
Frances, on February 28, 2009 at 10:20am, said:
Just wanted to add that I also found I had to restart windows before it would play ball, but otherwise this works exactly as it says. Thanks for the tip!
Edit Comment
Rejean, on March 31, 2009 at 2:17pm, said:
Like everybody else said, many thanks for this post, it was really helpful.
merci beaucoup!
Edit Comment