Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

curl -v -i localhost
* timeout on name lookup is not supported
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

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.

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?

share|improve this question
    
Does telnet localhost 80 work? –  Jenny D Jun 3 '13 at 13:07
    
Yeah, telnet does work –  Dan Jun 3 '13 at 22:53
    
Given that, it's unlikely that it's apache or network config. It might be your own settings - do you by any chance have http_proxy defined in your shell? –  Jenny D Jun 4 '13 at 7:06
    
Sorry for the delay. I'm only able to play with it while I'm at home. I don't have an http_proxy variable set. I can confirm that I am able to ping localhost, use wget and telnet. For some reason, this seems to be curl acting funky. If it's not likely to be apache or network, I'll start looking into curl config and my firewall settings. –  Dan Jun 4 '13 at 23:35

1 Answer 1

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. IT helpdesk 101, right? For anyone with trouble in the future, while I was using the verbose option (-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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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