PHP CURL is too slow for localhost

后端 未结 4 1558
暗喜
暗喜 2020-12-17 22:26

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

4条回答
  •  萌比男神i
    2020-12-17 23:05

    I had the same problem and finally discover that it was coming from two facts :

    1. I use Mac OS X Mavericks
    2. I accessed my project via the URL 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.

提交回复
热议问题