Active12 days ago
I am running XAMPP (Apache, MySQL and PHP) on my Windows Vista computer. I have
curl
installed on my machine. When I try to curl
my localhost
in the command prompt, I get the following:However, if I
curl
a live site, such as Google, it fetches appropriately. This issue only appears when using the command line. I am able to curl localhost
from my local server via PHP script without any issue.Yes, localhost should be serving files (the default XAMPP welcome message - which I did see from localhost when it was first installed). Bizarrely localhost/index.html does work (this is just an 'It Works' message) and now localhost/xampp has started working again, as well as any localhost/XXX URL. But the bare localhost (or 127.0.0.1) does not. As I know so far Drush has some limitation on Windows. I need however, to get it working, and I have activated the curl module in php.ini. All you need is to uncomment the line: extension=phpcurl.dll Now, I run phpinfo.php and it seems curl is activated, but I still get the console error: wget or curl executables not found.
Is this a result of some sort of Apache config? Or is there some sort of network or Internet settings that need to be configured/adjusted in Windows to get it to work right?
JakeGould35.8k1010 gold badges113113 silver badges154154 bronze badges
DanDan
1 Answer
I tried out a couple of different config options, tweaked my firewall and setting a proxy, with no real effect. I set it back to the defaults and decided to restart my comp (had Windows updates pending). When the computer restarted, I tried again and was able to connect via
curl
. While I can’t really tell what was hanging up in particular, a fresh restart cured the problem. I.T. helpdesk 101, right?For anyone with trouble in the future, while I was using the verbose option (
JakeGould-v
) on curl, I found that for the most information about the connection attempts, it’s best to use --trace
, or even trace in conjunction with -v
.35.8k1010 gold badges113113 silver badges154154 bronze badges
DanDan
Not the answer you're looking for? Browse other questions tagged apache-http-serverphpmysqlcurl or ask your own question.
Active6 years, 3 months ago
This question already has an answer here:
- How to enable cURL in PHP / XAMPP 18 answers
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.
Aakash ChakravarthyAakash Chakravarthy4,4021616 gold badges5454 silver badges7070 bronze badges
marked as duplicate by j08691, Jocelyn, Blazemonger, hjpotter92, Rudi VisserFeb 28 '13 at 19:09
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
![Install curl xampp windows 10 Install curl xampp windows 10](/uploads/1/2/5/8/125874641/618510054.jpg)
7 Answers
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
Step 2:
Uncomment the following line in your php.ini file by removing the semicolon (;).
After that it will look something like something below-
Step 3:
Restart your Apache server.
Step 4:
Check your
phpinfo()
to see whether curl has properly enabled or not.Enjoy using curl() library.
AnjumanAnjuman
It should be available in php.ini file. You need to un-comment the line for curl extension:
SarfrazSarfraz313k6666 gold badges486486 silver badges552552 bronze badges
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
mohitsonimohitsoni%XAMPP_HOME%/php/ext/php_curl.dll
file exist or not.2,50811 gold badge1313 silver badges1010 bronze badges
1) C:Program Filesxamppphpphp.ini
2) Uncomment the following line on your php.ini file by removing the semicolon.
;extension=php_curl.dll
3) Restart your apache server.
webvitalywebvitaly3,03466 gold badges2626 silver badges4545 bronze badges
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).
SimonSimon
You can add any extension (in Wamp and Xampp servers) by removing the semi-colon (;)
Vinicius MartinsonVinicius Martinson
For XAMPP on MACOS or Linux, remove the semicolon in php.ini file after extension=curl.so
Esteban CacavelosEsteban Cacavelos