Re-enabling error reporting in MAMP

For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be.

  1. Find your ‘MAMP’ directory in ‘Applications’
  2. Find ‘conf’ and open it up..
  3. Open up php4 or php5 (depending on your enabled version)
  4. Line 270 should be something like this:
    error_reporting = E_ALL
  5. Line 277 will be:
    display_errors = Off

    Change this to:
    display_errors = On
  6. Restart servers

And voila! We have PHP errors..

45 Responses

  1. Eli Sand

    I don’t even know what MAMP is, but there’s a very good reason to *NOT* have errors (PHP especially) piped out to the end client over the web (supposing that’s what you’re intending to re-enable).

    Should a bug arise somewhere where a user/pass is used to access information, it could be spat out to the browser, giving away sensitive info to your viewers! Same can be said about any potentially unsafe information, like directory structure, etc… It would give some extra info to hackers as to how to compromise your site.

    Just a thought if you value your site security.

  2. Jamie Huskisson

    Always do a search first Eli – http://www.mamp.info/en/index.php

    There’s a reason you’d want error reporting on whilst coding offline on your local development server for your clients.

    Whilst your comment is semi-valid, it’s not valid in the case of a local development server.

  3. Eli Sand

    Searching requires me to put forth effort in to the form of clicking, reading and junk like that. It’s far easier for me to criticize than it is for me to research what I’m criticizing.

    That and I personally frown on those bundled McDonalds meals. They always “do it for you” which leads to this exact, very, overly troublesome, always experienced, “why the…” issues which can so easily be avoided by the age old DIY method.

    Besides, writing errors to logfiles is always the best method for PHP. There’s always a chance that an error message gets embedded in html comment tags, meaning you never see it.

    That’s reason #2 for never turning on HTML errors. :P

  4. Jim

    Thanks mate,

    Although, you have to restart the server too!

  5. Jamie Huskisson

    Thanks Jim – I’ve now added that to the post ;)

  6. peter

    sure there is a good reason to NOT display errors to the client
    but you must be one hell of a novice programmer to not know the value of getting debug messages while you are developing, idiot

    secondly I wouldnt use this novice toy, mamp on a production site. Its a tool for novices and beginners who barely understand php and mysql

  7. otto gutschein

    thanks for that hint – had some nasty bugs here in my scripts i couldn’t find with errors turned off.

    don’t know why the MAMP-people disabled them in a development package :/

  8. frank

    Wow, some serious dickhead comment posters around here. novice toy? macdonald’s meals? sounds like a bunch of brats, its just web dev, take it easy.

  9. frank

    >a tool for novices and beginners who barely understand php and mysql

    MAMP is a perfectly handy developer setup, hotshot. Screw off poser.

  10. john

    thanks, this was just what i was looking for:)

    i think for you to write of mamp is plane silly, technically mamp is just the the initials of the stack so to say mamp is for newbies is actually an incredibly stupid thing to say. What I suspect you meant to say is that the package bundling them together is only for novices, but until you correctly learn the difference between a stack and a program I won’t be tacking you too seriously;)

  11. marxista

    Thanks, this helped me a lot! Greetings from Sweden.

  12. Wes

    MAMP is a beauty. Drag that baby to your applications and start her up. Real developers have deadlines to meet, and don’t have time to compile and install an entire technology stack for a simple dev environment.

    Also: “Besides, writing errors to logfiles is always the best method for PHP”

    Made me laugh. If you’re doing even semi-serious debugging, you’ve got a server debugger running. Therefore: display_errors = On.

    In conclusion: Peter + Eli = village idiots.

  13. Shane

    Great help! I’d been editing another PHP.ini, and wondering why I wasn’t getting errors showing.

    Guess that’s the standard install of PHP, rather than MAMP’s?

    Anyway, I’m happy, thanks to you.

  14. Hammy

    Thanks for the info. Totally agree with Wes about some of the comments above :)

    Greetings from New Zealand

  15. Pingback on

  16. Joachim

    Thanks for the info!
    Was getting fed up with the White Screen of Death…

  17. Josh

    Thank you! This was so frustrating.

  18. Mash

    Thanks Jamie.

    Peter you sound like a wanker. No-one cares about your ‘expert’ abilities except you. I bet you like to plaster W3C compliant logos all over your websites to tell the world you know about standards rather than just getting on with it.

    Anyone that has had to set-up a mac for local dev knows what a timesaver MAMP is.
    Apache, MySQL, PHP with phpMyAdmin and SQLlite as a one-click install bundle – bloody great – you can configure the stack anyway you want after that – such as tweaking php.ini to control your degree of error reporting as this post suggests.

  19. simon

    Works for me. Thanks.

  20. Dean

    Thanks! Other sites mentioned first part about E_ALL, but didn’t mention Line 277 display_errors to “On.” Thanks for being thorough!

  21. abc@abc.com

    Dear Eli Sand

    Would publish your site by xampp? If not then you should do know that most web developers don’t publish their site with xampp or mamp because they use them to develop site locally and since nobody could write perfect codes without errors, they normally turn display error on. You need that for debugging not for your visitors… Your visitors will see your site from another server which normally don’t came as a package like xampp or mamp. So stop, showing off, while other people are trying to share their knowledge and make the net a better net.

    A reader who happens to read your comments

  22. Rui Covelo

    Thanks for the tip. I lost a few minutes of my day until I found your post. It really doesn’t make sense to be off by default.

  23. Max

    Thanks mate! Its always nice to google and find REAL usefull info, you saved me a couple minutes :)
    Cheers!

  24. Pinto

    Thanks to this post, works for me too.
    I think Eli Sand uses IIS.

  25. bujisky

    thanks

  26. Neptúnus Hirt

    Great, thanks for the information.

    One note, however, for those that don’t know: If you’re using MAMP Pro, you need to navigate to the MAMP Pro application, then do a “Show Package Contents” on it to find the configuration files.
    I’ve had some trouble figuring that out, since I assumed that MAMP Pro accessed all the same files as MAMP, but simply had more configuration options.

  27. Dan Nicholls

    Thanks for this, a big help when developing and when you’re a total newbie to Mac and therefore a total newbie to MAMP!

  28. Chris

    Nice one, Jamie.

    This post saved a good few hours of frustration.

    Thanks very much.

  29. viopico

    Thank you very much^^

  30. Zack

    Thanks man I owe you a beer!

  31. Joe Elliott

    For those on MAMP Pro, a even more simple solution:

    Click on Server, then PHP… from there you get a fancy checkbox error selection.

    Thanks for the post! I was looking to figure out how to do it, did it first with your post, then explored MAMP more…

  32. Andrew

    Many thanks! Greetings from NYC!

  33. yc

    Awesome! Thanks. The lack of errors was making MAMP development impossible.

  34. Kit MacAllister

    Thanks, this was very useful. It’s so frustrating when the entire site disappears because of a missing semi-colon.

  35. Pieter

    Thank you for this. I’ve recently made the switch from PC to Mac and also changed from XAMPP to MAMP in the process. This post was incredibly helpful.

  36. Andrew

    Thanks for the tip. One of those little things that saved a few hrs of confusing frustration.

    This should come enabled on a testing server, in my book!

  37. vlado

    thanks a lot man – really nice tip!

  38. Constant Meiring

    /sigh/ Eli at the top seems to be quite daft. Thanks for the tip. I just did a search because I already enabled E_ALL with no avail. Seems I didn’t know about display_errors. :)

  39. rightmost

    Thank you, this has been very helpful! Debugging is now heaps easier now that I can actually *see* what the error is :D

  40. Brad Manderscheid

    Thanks a ton! This has been bothering me for a long time now.

  41. Bucky

    Thanks, that was really useful.

    Just spent a few hours trying to work out a problem with my code (I’m a complete newb to this) and it didn’t even click that I wasn’t getting an error on MAMP until I dropped the file on to my hosting and saw an error there.

    Now I can get back to my learning!

  42. Eduardo Rosado

    Thanks! during local development we do need error reporting enabled and your post at top of Google’s list was really useful to quickly solve this issue.

  43. Skar

    Thanks! Finally I can see some errors – which is useful when developing locally :D

  44. Alex

    Thanks handy info :)

  45. Jeger

    Thanks alot, i just moved to the apple platform on my laptop was confused for a minute why small php syntax errors would give me a 500 error.
    thank you.

    ps. Eli Sand, seriously? i understand you making a mistake when writing your first

Comments are closed, but feel free to @jhuskisson on Twitter with your thoughts.