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

Development Tools Setup Your Local Development Environment

Paul Criscitiello
Paul Criscitiello
3,313 Points

In MAMP, after setting web and mysql ports to 80 & 3306, mywebsite no longer works saying Safari can't connect to server

In MAMP, after setting web and mysql ports to 80 & 3306, mywebsite no longer works. It now says:

Safari can’t open the page “‎localhost:8888” because Safari can’t connect to the server “localhost”

I recently was trying to set up a local dev environment manually and believe this may be part of the issue. How can I reset everything I did before and just use MAMP instead?

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Paul,

Safari can't connect because it's looking for “localhost:8888” (as you stated above), but your port is set to 80, not 8888.

I don't use Safari (I actually recommend using Chrome for any development), but you should just be able to type "localhost" into the address bar with the MAMP settings at 80 & 3306. If that doesn't work, try "localhost:80".

I hope you get it figured, but like I said, I'm not entirely sure on the defaults for Safari.

:dizzy:

Paul Criscitiello
Paul Criscitiello
3,313 Points

Ok, thanks, I'll just try reinstalling if it continues to not function properly, and I'll look into getting an external HD.

Also, somewhat unrelated question but are you aware of any tutorials on how to have users create an account with login information on a website?

Thanks for the help.

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

That would need to be done with a Server-side language, so it would depend on which one your are employing. Here on Treehouse, there are some in the library, but a few are quite dated, so it may take a bit of extra work.

You could try Google, with <the coding language> + create user account (or user authentication).

:dizzy:

Paul Criscitiello
Paul Criscitiello
3,313 Points

I would use php and mysql for the database, as I have some experience with these. Couldn't find any great tutorials in the Treehouse library.

Paul Criscitiello
Paul Criscitiello
3,313 Points

Hi Jason, Thanks for responding. After restarting my computer, my MAMP is no longer working properly. It asks for a password every time I start it. When I click the preferences button nothing happens. And when I press start servers, it just loads and then doesn't start. In the top right, the apache server box is checked but the mysql server box is empty. How can I fix this/ what could the problem be?

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

That sounds like a permission error with MySQL servers. Are you entering the correct system password on startup? Mine also asks for a password as this is a setting I've turned on. The password is the admin one for your Mac. This allows the MySQL servers to start.

If this isn't the issue, you can try un-installing and re-installing. But aside from that, I apologize I couldn't be more help. Code I'm good with... but Software / Hardware issues, not so much.

A while back... I accidentally deleted the root user from my database permissions. It was pretty much unfixable, thank goodness I had Time Machine Backups, so I just restored everything from a moment before I deleted everything. Honestly, if possible, buy yourself an external HD (Mines a WD for Mac 1TB for ~$90) and set up Time Machine. I never used it until I started coding... it is a lifesaver.

I hope you get things figured out. :)