I have setup two apps in my WAMP environment. Performance of both the sites is OK. They return data in less than a second. The problem is that when I curl one site from anot
I had the same problem and finally discover that it was coming from two facts :
http://myproject.local/
because I put a line 127.0.0.1 myproject.local
in /etc/hosts
It is because the .local
tld is reserved for Bonjour service, and this since Mac OS X Lion (10.7).
Changing the tld for something else fixed the problem.
If you are using *.local TLD, you can solve this and enjoy fast loading times by adding both, IPv4 and IPv6 entries in the hosts file
127.0.0.1 test.local
::1 test.local
Best
Yes, is a DNS lookup problem.
On Windows 7 x64 i managed to overcome this issue
(curl call between applications on different ports in localhost) by editing the host file ( C:\Windows\System32\drivers\etc ).
Un-comment on the line that says: 127.0.0.1 localhost , reboot and you're done.
I solved this problem by setting up different virtual hosts such as sitea.dev and siteb.dev If you use the same host for both sites on your localhost Windows machine, then you get a long delay (the same as if there is a Fatal PHP error). It's not a problem with Curl since file_get_contents(url) gave me the same issue.