Enable Curl on Xampp
I generally do my development work on a local windows machine with the latest version of Xampp installed. I was recently toying around with the tayst twitter feed, and was having trouble using curl with xampp.
The problem?.. curl was not enabled by default in Xampp. You receive the following error:
- Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\tayst\twitter\index.php on line 4
The solution? These simple steps!
Step 1. Stop all Xampp services: Apache, Mysql, Filezilla, and Mercury.
Step 2. Open the following files in your editor of choice. (Replace C:\xampp with the location of your xampp install)
Step 3. Find the following code in each of the files, and remove the ; (semicolon) at the beginning of the line. You will most likely see it at line 546 or line 582.
- old line – ;extension=php_curl.dll
- new line – extension=php_curl.dll
Step 4. Start your apache services.
See what an easy fix to curl on xampp by simply removing a few semicolons. Happy Coding!
Note: Post is imported from my writings here … there may be some comments there that are helpful!