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! While you're at it, check out some resources Treehouse students have shared here.

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

PHP

Ryann Green
Ryann Green
11,010 Points

MAMP 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
Ryann Green
11,010 Points

I 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.

Ah, 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. :]

Ryann,

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
Ryann Green
11,010 Points

I 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.

Ryan, 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
Ryann Green
11,010 Points

I 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
Ryann Green
11,010 Points

Indeed. 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
Jesus Asensio
13,435 Points

I'm having the same problem. Do you need to do this every time you start MAMP?

Jesus,

Normally, no.

Jesus Asensio
Jesus Asensio
13,435 Points

Thank you, James!

It's odd... I just lost internet conexion and I needed to do it again :s Do you have any idea?