On a basic installation of MAMP, I\'m building an application with CodeIgniter locally (MacBook Pro, Core2Duo 2,26 GhZ, 4GB RAM).
My problem is, tha
The '.local' domains conflict with Bonjour, which treats anything with a '.local' TLD as a Bonjour server.
I found the answer here: http://www.bram.us/2011/12/12/mamp-pro-slow-name-resolving-with-local-vhosts-in-lion-fix/, and that post refers to https://discussions.apple.com/message/15834652#15834652.
The solution is to, as Jon said, put a ::1
address in/etc/hosts.
::1 localhost example.local anotherexample.local
Unfortunately, MAMP Pro will delete the entry when it restarts so put a tab (not spaces) between the IP and each of the hosts.
The alternative is to put a different TLD - .dev
or something like that.
To solve the problem with .local domains on OSX, do the following (assuming your site is called mysite.local):
/etc/hosts
file in a text editor::1 mysite.local
This should resolve your issue.
If on OS X Yosemite. The edit to the localhost file will not fix it. You will need to do the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
The fix is via https://coderwall.com/p/ylchfq. Update is in the comments.