Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ryann Green
11,010 PointsMAMP Not Working Correctly
I have just installed MAMP. After installing, I changed the Apache port to 80, and started the servers. Apache and MySQL both started, but when I opened the start page, it led to a "The webpage is not available." More information led to an error that began as follows: "The server at localhost can't be found, because the DNS lookup failed." I am on Mac OSX 10. I then tried changing the ports, turning of my firewall, etc.
While trying to figure out what was going on with that, I restarted MAMP and now it will only connect to the Apache server, but not MySQL. This was supposed to be the easy part, and I'm not sure what I'm doing wrong. Please help me! D:
5 Answers

Ryann Green
11,010 PointsI seem to have figured it out. For anyone who might have the same problem, whenever i was in terminal and used "ping localhost", I came upon this error "ping: cannot resolve localhost: Unknown host". However, running "ping localhost." with the period, it worked! Strange.
With a little research, someone had suggested that it might be a DNS problem and it should be reset. After running "sudo dscacheutil -flushcache" in Terminal, and opening the start page on MAMP, it finally showed up.
I'm not really knowledgable enough about all this to know exactly what happened, but as of right now, those steps seemed to clear it up.

James Gill
Courses Plus Student 34,935 PointsRyann,
The default MAMP ports are:
mySQL: 8889 Apache: 8888
Did you try running MAMP with the default ports, then going to localhost:8888/ ?

Ryann Green
11,010 PointsI did. I cannot connect to the servers with the default ports. I can now connect to the servers with the port on 80 for Apache and 3306 for mySQL, but the localhost page is still being obstinate.

James Gill
Courses Plus Student 34,935 PointsRyan, do you have the latest version of MAMP? If so, then there may be a conflict with some other app or service using the ports.
Also, I don't understand how you can "connect to the servers" on 80, but can't see localhost. if you can't see localhost, and you're using the proper URL, then MAMP isn't correctly configured.

Ryann Green
11,010 PointsI do have the latest version. I just downloaded it earlier this afternoon. Is there a way I can tell if there is anything conflicting with the ports?
I am using the secondary defaults that MAMP suggests for both Apache and mySQL because I could not connect using the 8889 and 8888 ports. Both servers light up when I start them, and when I click open start page it automatically sends me to "http://localhost/MAMP/?language=English". I haven't changed any other settings, so I'm not sure what I did to it or how else to configure it.

Ryann Green
11,010 PointsIndeed. I'm just glad that I eventually came upon the answer. Hahaha. Thank you. I'm sure this is just the beginning. Luckily for me, part of the reason I am so interested in it is the problem solving, so I guess it's just part of that. Thank you for your help. (:

Jesus Asensio
13,435 PointsI'm having the same problem. Do you need to do this every time you start MAMP?

James Gill
Courses Plus Student 34,935 PointsJesus,
Normally, no.

Jesus Asensio
13,435 PointsThank you, James!
It's odd... I just lost internet conexion and I needed to do it again :s Do you have any idea?
James Gill
Courses Plus Student 34,935 PointsJames Gill
Courses Plus Student 34,935 PointsAh, the OS X DNS cache was a problem. Ouch, a painful problem--but you are stronger now for having solved it. The good news is--you were doing all the right things and still having a problem. Welcome to programming. :]