Installing Magento in MAMP

Magento. Truly the kitchen sink of open source shopping carts and e-commerce packages, and with enough features to shake a stick or spanner at, but like a kitchen sink, it can take a little specialist knowledge to install.

Attempting a localhost installation of Magento v1.3.2.4, using Godsend and development life-saver MAMP, I came across an issue unseen in previous versions, and although the issue is documented, it may be of some benefit to explain its work around in more detail, especially when in combination with MAMP

During installation Magento sets cookies, and many browsers will refuse to accept them when the installation is at the MAMP default URL, http://localhost.

As the Magento installation notes explain:

DNS resolution (important)
During the installation Magento will set cookies and most browsers will refuse to accept cookies for localhost. This can lead to several problems but no error messages. E.g. when trying to set the locale the page will just refresh and revert to the standard En-US locale. To avoid this problem create another entry for localhost in your /etc/hosts file and use that hostname to access the site:
127.0.0.1 locahost www.localhost.com

Aside from being unable to set location information during install, I had the more critical issue of being unable to log into the Admin page afterwards, both in Firefox and Safari—basically a complete show stopper.

The workaround is as suggested in the install documentation, but slightly adapted for MAMP.

Creating a new host in MAMP

1. Open the MAMP application
2. Navigate to the Hosts panel
3. Create a new entry for localhost:

Server Name: www.localhost.com
Disk location: /Applications/MAMP/htdocs (default MAMP site root)

Special Operations: Installing Magento in MAMP

Which has the effect of changing your Magento installation location:

Default MAMP installation URL: http://localhost/magento
New MAMP installation URL: http://www.localhost.com/magento

Your browser will now accept cookies, and critical access to the Magento Admin page will be restored.

Tags: , ,

Be Social

12 Responses to “Installing Magento in MAMP”

  1. Thomas says:

    Great Tips! I’m always looking for Magento Extensions and mods to improve Magento. Thnx!
    .-= Thomas´s last post: Magento Plug-ins & Extensions =-.

  2. Roland says:

    Yip, localhost entries will give all sorts of errors as well as redirection loops.

    Thanks for the update

  3. Ron Peled says:

    Ah, this is the missing guide! I am coming from the PC world and setting this up on my new mac is not easy. Thanks for the tips.

  4. As a blog reader, I am readily on the search for information that are both awesome and worthwhile to read and I must say your blog passed with high honors. Thank you so much for the wonderful content you have created! Will be coming back soon!

  5. Kimberely Bradrick says:

    I was suggested this website by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks!

  6. I’m amazing? Thanks for saying Kimberly. For some reason I’m struggling on this point at least to argue with what you’re saying!
    John Gillespie´s last post: DEVASTATION- White iPhone Too Thick

  7. Cheolsu says:

    Thanks for the tips. I am new to Mac too.
    Cheolsu´s last post: Google Street View

  8. dante d says:

    fantastic im moving from open cart to Magento so this should be a great help thanks

  9. Mike Key says:

    Great short post. I love MAMP and I’m so glad I switched from a Windows environment to a Mac environment for all my web work. There are A LOT more steps to go thru to get Magento to work with WAMP.

    I you should mention though that people need to stay on top of the file permissions with MAMP Pro or you can end up with an error message that the server is misconfigured.

    Good stuff btw. Oh and beautiful website design. Came here via google, first link. Nice ranking bro.

  10. Thanks Mike, yes, you’re right, I should probably update this post at some point as MAMP itself is a fast-moving target. (Shudder) …using WAMP on Windows, no thanks!

    A future update could also include how to get MAMP working together with a Windows install in a virtual machine, which is something of a must for a web developer working on a Mac.

  11. Doesn’t seem very hard to do! Thanks for the post

  12. Thanks for the tip. Not sure if this remains an issue, but I took went ahead and used my Mac’s local address, e.g. macintosh.local, and included the default 8888 MAMP port in the base URL and it seems to be doing just fine.

Leave a Reply

CommentLuv badge