Enabling PHP Error Reporting in MAMP

While developing PHP applications with MAMP on OS X, it is very useful to be able to see errors being printed directly in the browser. By default, this is disabled with MAMP, but it is very easy to enable error reporting in MAMP. All you have to do is to follow the simple steps below.

  1. Navigate to /Applications/MAMP/bin/php/php{your-version}/conf and open php.ini. If you are unsure which PHP version you are using, then open the preferences within MAMP and check the PHP tab.
  2. Search for display_errors and change the value from Off to On. Just above this, you can also configure which errors you want to be displayed by configuring error_reporting, but it is recommended leaving this to E_ALL for development environments.
  3. Restart your Apache web server by stopping and starting your servers in MAMP.

If you are using MAMP Pro, you should enable this in the user interface by checking the “To: Display” option within the error handling configuration. See more about that here.

You will now see errors printed on the screen if you run a PHP script that triggers errors, warnings or notices.

One Comment

  1. Vadim said:

    Now it works! Thank you very much!

    October 23, 2016
    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *