Jump to content
Larry Ullman's Book Forums

Setting Up Curl For Xampp


Recommended Posts

Hi Everyone,

 

This post really isn't a question, but more of an explanation as to how I finally figured out how to set up cURL for XAMPP, which you need to do for communication with the Authorize.net API. You wouldn't think it would be that difficult to set up, but (at least for me) it took me about an hour to get it to work properly. Maybe this post may save someone in the future that hour.

 

To start, Larry talks about page 252 that you can simply run phpinfo() to see if curl is enabled. When I ran phpinfo(), I simply did not see a setting that said "curl" at all. In other words, there was nothing telling me if curl was either enabled or disabled -- which I correctly interpreted to mean that curl was disabled.

 

I then went into the php.ini configuration file (for me, located in xampp/php/php.ini) and removed the semicolon before "extension=php_curl.dll". The semicolon comments out a line, so you are essentially "un-commenting" the line.

 

I must admit that I was confused, because I always believed there were 2 php.ini files -- one in the apache folder and one in the php folder I believe. Apparently, in recent releases of XAMPP, they have omitted the extra php.ini file and now it only exists in the php directory, so there is no need to change another php.ini file -- assuming you running the more recent versions of XAMPP. Check to see if your particular version has one or two php.ini files -- I don't know if having two files will make a difference in getting to curl to work.

 

Once you have uncommented the curl line in php.ini, IMPORTANTLY, YOU MUST RESTART XAMPP IN ORDER FOR CHANGES TO THE CONFIGURATION FILE TO BECOME EFFECTIVE. So I restarted the apache server and mysql, and after that, curl became enabled. Once I ran phpinfo(), the curl heading appeared and it said "enabled" -- whereas before there was no indication of whether or not cURL was enabled.

 

Hope this helps. If I've missed something or made an erroneous statement, please chime in, but this took me like an hour to figure out.

Link to comment
Share on other sites

Thanks for this gameface. I acutally got a new system yesterday and installed xampp again. I don't know about the Apache php.ini file but I had 2 php.ini files insise the php folder. One development and one production.

 

Anyway, thanks, I'm sure this will be useful to many people

Link to comment
Share on other sites

Haha! This post made me laugh because I had the EXACT same issue. Thanks for summarizing it. I also ran into the issue of two php.ini files in my installation at the time.

 

Definitely, always use the most up-to-date XAMPP. I usually just do a search from the xampp folder to quickly find the file. Once you're in the file, if you text editor supports searches, just search for "curl". There's only one.

 

And yeah, the most important thing is to shutdown and restart the XAMPP Control Panel. I had the same problem as you.

 

Thanks a lot for this post.

Link to comment
Share on other sites

 Share

×
×
  • Create New...