MAMP is a simple way to get a standard Apache/MySQL/PHP install running on a Macintosh for local web developement purposes, like EasyPHP on Windows or XAMPP on Linux. MAMP has builds available for both Intel and PPC-based Macs.
On OSX 10.4, a Dashboard widget lets you start/stop the servers and switch between PHP versions 4 and 5. There’s also a button that supposedly opens a MAMP start page. That button does not work for me, and apparently I’m not the only one with that problem. It’s not a big deal, but I am a crazed perfectionist, so I fixed it. How?
- Go to /Users/YourUserName/Library/Widgets in the Finder.
- Control-click Mamp Control.wdgt and choose "Show Package Contents".
- Open the file called mampwidget.js in your favorite text editor. I used Smultron.
On line 90, you should find the following code:
var startPage = widget.system("/usr/bin/defaults read com.webEdition.MAMP startPage",null).outputString.replace(/[\r\n]/,"");
See the com.webEdition.MAMP part? That points to a preference file that does not exist. The correct name is com.living-e.MAMP – go ahead and edit line 90 so that it reads:
var startPage = widget.system("/usr/bin/defaults read com.living-e.MAMP startPage",null).outputString.replace(/[\r\n]/,"");
Save and close. Hit F12 to go your Dashboard, remove the Mamp Control widget and put it back. Make sure the servers are running, then click the Open start page button. See it work. Post a comment here and praise my immense talent, and infinite modesty.
I tried it and it didn’t work for me, as a matter of fact, doing this removed the names from the buttons in the widget and the page still didn’t open. Hmm … gotta go back and check more into this now that you exposed the opportunity. I will let you know what I figure out. Thanks.
I also tried it, but it didn’t change anything. Just doesn’t work!
Damn! Well, it does work for me… maybe this has to do with the different MAMP builds? I am using the Intel version 1.3.1…
Didn’t work for me either. I even downloaded the stock Smultron, didn’t change anything in Smultron Prefs, just opened the .js file you referred to and saved. Could you provide more details as to what it should be point to on line 90. Perhaps ‘ad’ is right about the builds. Which build did you edit for? More importantly how did you figure it out?
(ad = me = post author)
You all should check in /Users/YOURUSERNAME/Library/Preferences and look for the “com.living-e.MAMP.plist” file. That is what the code on line 90 is supposed to read. If it is not there, maybe open the MAMP preferences panel and modify something to recreate the file. You could add or delete a slash from the start page URL for example…
Checked in Library and in MAMP files – no such file. Didn’t work for me – good try though
This totally worked, and in addition it put me on the right path to discover why the apache indicator in the widget was malfunctioning – the httpd.pid path was wrong. If your LEDs aren’t working, I suggest that you do a search for mysql.pid and httpd.pid in the MAMP folder, and then edit the mampwidget.js file vars “apacheIsRunning” and “mySqlIsRunning” paths to point to the correct files.
DootDeDoot!
Pingback: A Swarm of Iwarunas 2.0-alpha » Mac OS X 3rd party applications
Worked for me – Nice! Just wanted to add that you are immensely talented and infinitely modest. But then, you knew that already. /P
Well, it’s been a while since this post and for a while my widget has worked fine, however I installed the latest version the other day after i reformatted my computer, the widget was now grey and wont open the start page, so i assume they updated something. And filling out your full name and email for a download sucks.
Also, most of the support questions there were not answered or replied to, the only one which was remotely helpful was the reply which led to your post. However it didn’t work.
Just yesterday I downloaded the package from http://sourceforge.net/projects/mamp/ – without having to fill out any forms. The widget required my fix again, and it worked.
Pingback: Iwaruna.com » Mac OS X 3rd party applications I use
still no luck…which is a total bummer, even though its not a huge deal I just like things to work.
I’m running 1.4.1 now.
Worked, thanks!
I’m having the same problem. I’ve tried changing the js file and the com.living-e.plist file does exist. Has anyone found a fix?
Thanks for the fix. It didn’t work in the first place, because there was no key named »startPage« in my “com.living-e.MAMP.plist” file. . I simply added it with the value “/MAMP” and it worked. Hope that helps those who are still stuck.” (By the way, I use PrefEdit to view and edit plist-files)
Thanks for the widget fix, that saved me a lot of time.
At first it did not work for me. The com.living-e.MAMP.plist file did not exist. I followed your recommendation to change something in the preferences panel. I tried it a couple of times. At least for me, I had to have the servers on for the changes to take effect. The file was created and the widget works fine now. Excellent job!
What exactly do I have to change in the preferences panel?
OS10.5, iMac intel core duo
MAMP 1.7.1
com.living-e.MAMP.plist does not exist
Start page does open when I click “Open start page” button in the actual MAMP application.
It doesn’t matter that much since it works, but kind of bothers me that the handy looking widget doesn’t work….
Thanks.
Sorry, I asked too quick..
Seemed to have taken a little while to make the file.
All I did was open the preferences pane, looked under all the tabs without changing anything, clicked “ok” button, few minutes later (while I was writing the previous question) the file was made.
Cheers.