68

How to enable curl in xampp ?

My PHP twitter application needs curl function. But it is not enabled in XAMPP. how to enable it. I found no options for doing that.

1

7 Answers 7

78

You have to modify the php.ini files in your xampp folder. Three files in three different places need to be changed.

Follow the following steps to enable curl library with XAMPP in Windows:

Step 1:

Browse and open the following 3 files

C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini

Step 2:

Uncomment the following line in your php.ini file by removing the semicolon (;).

;extension=php_curl.dll

After that it will look something like something below-

extension=php_curl.dll

Step 3:

Restart your Apache server.

Step 4:

Check your phpinfo() to see whether curl has properly enabled or not.

Enjoy using curl() library.

5
  • 16
    Worked great! The current version of Xampp only uses a single php.ini (phew!) which is in ./php/php.ini so I only needed to make the update in one spot.
    – niczak
    Commented Jun 25, 2013 at 18:21
  • 5
    +1, Beautifully put-up. Commented Feb 6, 2014 at 16:23
  • 1
    Post is old now, XAMPP Version: 5.6.30 has only one \xampp\php\php.ini file, apache\bin or php\php4\ is not available Commented Feb 15, 2018 at 12:12
  • 4
    in latest versions it is like extension=curl and it is already enabled. thanks Commented Apr 2, 2019 at 11:46
  • @MindRoasterMir yet the error still occurs
    – Fethi
    Commented Jan 1, 2022 at 18:49
50

It should be available in php.ini file. You need to un-comment the line for curl extension:

  ;extension=php_curl.dll
  ^----- remove semi-colon
3
  • where to find that file ? in which folder Commented Jun 11, 2010 at 4:16
  • 7
    e.g. c:\xampp\php\php.ini Commented Apr 2, 2011 at 14:37
  • cannot find extension=php_curl.dll in php.ini filr Commented Dec 13, 2018 at 8:04
23

In XAMPP installation directory, open %XAMPP_HOME%/php/php.ini file. Uncomment the following line: extension=php_curl.dll

PS: If that doesn't work then check whether %XAMPP_HOME%/php/ext/php_curl.dll file exist or not.

0
5

1) C:\Program Files\xampp\php\php.ini

2) Uncomment the following line on your php.ini file by removing the semicolon.

;extension=php_curl.dll

3) Restart your apache server.

1

First, make sure you have libcurl (see: http://curl.haxx.se) installed. Then make sure your copy of PHP has been compiled with the --with-curl[=DIR] flag. For more info see:

If XAMPP comes pre-compiled with cURL you may just need to enable the extension in your php.ini file (usually by removing a semicolon at the start of the line which includes the extension).

1

You can add any extension (in Wamp and Xampp servers) by removing the semi-colon (;)

1
  • 2
    Unless you specify where to remove the semi-colon, this is hardly helpful to most of users. I'm marking this "Recommended Deletion" from the review panel but once you update your answer other reviewers probably won't do that. Best regards
    – YakovL
    Commented Jan 25, 2018 at 12:46
0

For XAMPP on MACOS or Linux, remove the semicolon in php.ini file after extension=curl.so

3
  • Not sure about linux, but extension=curl.so is not in the php.ini file for XAMPP on Mac OS X.
    – minhaz1
    Commented Mar 10, 2015 at 7:43
  • I can't find php.ini Commented Apr 9, 2015 at 8:03
  • /Applications/XAMPP/xamppfiles/etc/php.ini ? Commented Apr 9, 2015 at 13:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.