Enabling PHP Error Reporting in MAMP
Published on October 12, 2015 by Bo Andersen
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.
- Navigate to /Applications/MAMP/conf/php{your-version} 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.
- 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.
- 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.
11 comments on »Enabling PHP Error Reporting in MAMP«
Now it works! Thank you very much!
File locations have has changed since this was written. For step 1 go to \MAMP\conf\php{version} to find php.ini .
Also in \MAMP\bin\php\php{version} you may find two files named php.ini-development and php.ini-production that you can use to overwrite the above php.ini. The development one has error reporting enabled together with more useful configuration.
Thanks a lot for the heads up, Andrew! I have updated the path within the post. Thanks again! :-)
In MAMP 5.2 I just downloaded it, it is not displaying errors. Line 472
Feb 2019:
For me, Only editing the file @ /Applications/MAMP/bin/php/php7.2.10/conf/php.ini worked
Obviously my PHP version is 7.2.10 (change this to whatever is reported in your phpinfo file.
Thanks Paul
And where is this on Mamp for windows?
Thanks a lot, Andrew!
I was really wondering, why my changes in the php.ini did not help.
It was overwritten by MAMP\bin\php\php{version}
I had really been looking for this. Thank you!
Thank you very much for this. It works.
Thank you!
I am learning to code and to see error messages helps a lot for debugging…
Thanks a lot Paul your way is work on me too and also thanks for Bo too he did made that beautiful solusion started and Paul made the finish!
Guys you can use this way too if the first one dont work. /Applications/MAMP/bin/php/php7.4.2/conf/php.ini
best regards Berk.
This one worked for me.Thank you!