4

This is a weird problem: a vhost in apache has been configured on my local machine in order to accept request like http://dev.myproject.com - my hosts file consists of a corresponding entry, e.g.

127.0.0.1 dev.myproject.com 

Now, if I use the URL http://dev.myproject.com in my browser everything works like expected, i.e. index.php will be executed.

However, if I start my console and use

curl http://dev.myproject.com

it seems to ignore the entry in my host file, i.e. it tries to find http://dev.myproject.com using DNS resulting in

curl: (6) Could not resolve host: dev.myproject.com

Any ideas? I'm stuck...

itsame69
  • 1,482
  • 5
  • 17
  • 36
  • Has already been answered here: http://stackoverflow.com/questions/3390549/set-curl-to-use-local-virtual-hosts – itsame69 Mar 24 '15 at 18:25

1 Answers1

3

use the --resolve flag on your CURL command

drj
  • 534
  • 2
  • 13