Skip to content

MAMP: Macintosh, Apache, MySQL & PHP

Through Michael Doig’s excellent tutorial, I recently discovered MAMP, a free package which provides recent builds of Apache, MySQL and PHP as a standalone installation on Mac. It’s geared towards local server development on a machine, as opposed to live sites, so it’s great for testing out stuff like WordPress locally.

Unfortunately, MAMP has issues. First of all, there is no documentation or even a FAQ which addresses the simple question of how to update MAMP. After taking a hint from the MAMP forums, it turned out to be rather straightforward:

  1. Stop the servers; I did this via the MAMP widget.
  2. Backup /Applications/MAMP/htdocs/ —basically any web content that you have added or changed.
  3. Backup /Applications/MAMP/db/ —your database(s). MySQL instructions: Actually, don’t backup the default /Applications/MAMP/db/mysql/mysql/ or /Applications/MAMP/db/mysql/test/ folders, which are usually updated. Only backup the other folders and files under /Applications/MAMP/db/mysql/ which are specific to your installation.
  4. Backup other folders you had added to /Applications/MAMP/, such as a Gallery 2 data folder.
  5. Replace /Applications/MAMP/ with the newer version.
  6. Replace the content and database folders with the ones you had saved in steps 2 through 4.
  7. Uninstall the previous MAMP Dashboard widget, then install the newer version (which is located in /Applications/MAMP/). Apply any widget fixes (see below).
  8. Restart the servers, again via the MAMP widget.

Ah, and the other problem: The “Open Start Page” in the MAMP widget doesn’t do anything. (The Start Page does open if I launch MAMP.app, oddly.) I found a helpful fix at gaarf.info, where you edit mampwidget.js (in the Mamp Control widget package contents) to correct a preference file reference. Using your favorite text editor, go to line 90:

var startPage = widget.system("/usr/bin/defaults read com.webEdition.MAMP
startPage",null).outputString.replace(/[\r\n]/,"");

Change com.webEdition.MAMP to com.living-e.MAMP. Start Dashboard, hit the Manage Widgets (+) button, remove the MAMP widget (tick its ‘x’ button), then re-add it from the Manage Widgets strip. Restart servers, and the Open Start Page button now works. Whew.

I hope the MAMP folks can fix these simple issues of documentation and the widget. It’s a shame their forums seem to be plagued with spam (at least the English ones), too, which makes finding answers a bit slow.

Update (6-Nov-2006): Thanks to Holger Meyer for answering my email about upgrading!

Update (22-Feb-2007): The latest 1.5-beta1 still has the Start Page bug with the Dashboard widget. Gallery 2 and some of the WordPress plugins no longer seem to work. 🙁

Update (8-May-2007): MAMP 1.6 came out, and still has the Start Page bug with the Dashboard widget. The download now includes both the free and Pro versions of MAMP. Gallery 2 stoutly refused to run (blank page issue), but the workaround was easy: In the php.ini configuration file, increase memory_limit from 8MB to 16MB. While Gallery will run when given 12MB, the WPG2 plugin won’t work (no random image in Sidebar), unless memory_limit is set to at least 16MB.

Update (17-July-2007): Was noodling around the MAMP website and noticed that version 1.6.1 was released on 11 April 2007. Likely a typo in the date, since the files have a timestamp of 15 May 2007. The widget bug seems to be fixed at least (enfin!). The packages listed on the releases page are the same between 1.6 and 1.6.1. It’s a shame, though, that MAMP hasn’t had a more recent, thorough update to include the latest Apache, MySQL, PHP and phpMyAdmin bits (compare with the newer packages in XAMPP for OS X, a less mature OS X server bundle). You’d think they’d do that to keep the paid MAMP Pro version up to date.

8 comments

  1. Kojilab wrote:

    Hi,
    How did you change the memory_limit? I’ve been trying many times but it seems it’s overriding my changes back to 8M when I launch the server.
    I change it unded /MAMP/conf/php5/ but it doesn’t care and still uses /Library/Application Support/living-e/MAMP PRO/conf/php.ini and even updates it.
    Thanks for your insight.

    Tuesday, 12 June 2007 at 4:50 pm | Permalink
  2. Kojilab wrote:

    I found out. I had to edit the template and not the php.ini file directly.

    Tuesday, 12 June 2007 at 5:21 pm | Permalink
  3. sairuh wrote:

    Hm, interestingly I was able to edit /Applications/MAMP/conf/php5/php.ini. I wonder if the difference is that I’m using the free version of MAMP, and that the MAMP Pro version (if that’s what you’re using) behaves differently. The file /Library/Application Support/living-e/MAMP PRO/conf/php.ini doesn’t exist for me.

    Wednesday, 13 June 2007 at 11:44 am | Permalink
  4. peter wrote:

    when i make changes to
    /Applications/MAMP/conf/php5/php.ini
    it doesn’t reflect on phpinfo(),
    it is somehow getting over written somewhere else.
    please help if you know what’s wrong.
    i’m using the free version of MAMP

    thanks

    Sunday, 7 October 2007 at 10:13 pm | Permalink
  5. sairuh wrote:

    Peter, it works for me, at least when viewing phpInfo from the MAMP Start Page. However, I’m still on v1.6.1; haven’t upgraded to 1.7 yet. The MAMP forum might have more info (though still spammy these days, alas).

    Tuesday, 9 October 2007 at 2:10 pm | Permalink
  6. Chuyen wrote:

    Hi Kojilab,
    Can you tell me how did you do to change the parameters in PHP.ini file?

    Thank you so much!
    Chuyen

    Sunday, 1 March 2009 at 10:56 am | Permalink
  7. scoober wrote:

    In Mamp Pro — the controls are under ‘file’, ‘edit template’

    Saturday, 14 March 2009 at 9:14 am | Permalink
  8. A.D. wrote:

    SCOOBER – thanks a lot!

    Friday, 10 July 2009 at 11:32 am | Permalink

Submit a comment

Your email is never published or shared. Required fields are marked with a red diamond, .