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() inC:\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)
- C:\xampp\apache\bin\php.ini
- C:\xampp\php\php.ini
- C:\xampp\php\php5.ini
- C:\xampp\php\php4\php.ini
- C:\xampp\php\php4\php4.ini
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!
0 nhận xét:
Post a Comment