MAMP not connecting to localhost

六眼飞鱼酱① 提交于 2019-12-11 20:53:53

问题


Just updated MAMP to version 3.2.1 on Yosemite. Both Apache and MySQL servers are green but when I go to my localhost I keep getting: This webpage is not available ERR_NAME_NOT_RESOLVED in browser (Chrome). I’ve tried incognito browsing and Firefox with the same result, tried both the MAMP default port settings and ports 80 & 3306, tried a reinstall of MAMP and rolling back to previous install of MAMP; all without success.

Can anyone suggest how to fix this…it’s starting to drive me crazy!


回答1:


Possible Thoughts;

  • In your /Applications/MAMP/htdocs/ folder, is there something in there for your browser to load? Some sort of index.html or index.php file? Could it have gotten removed accidentally?

  • When you launch MAMP and go to Preferences -> Ports, what is the Apache port? You mentioned you tried the default (8888/8889) and 80/3306, but could the port number somehow have gotten changed?

  • Is there any chance that some other Apache service is running? This is unlikely as you mentioned that MAMP shows Apache status as green, but it could be worth stopping MAMP, opening Terminal and doing sudo apachectl stop, returning to MAMP and changing the ports to 80/3306, then returning to Terminal and doing sudo apachectl restart. Then return to MAMP and start services again.

  • If none of the above work, what if you set the Apache port in MAMP's preferences to something random, like 8712, and then try http://localhost:8712/ to see if it loads.

Let us know if you've tried those already!




回答2:


Had a similar issue. If 127.0.0.1 is working then you just need to point localhost to 127.0.0.1. Edit /etc/hosts file (requires sudo) and include 127.0.0.1 localhost

That resolved it for me.



来源:https://stackoverflow.com/questions/29729926/mamp-not-connecting-to-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!