Enable Error Reporting Php Mamp
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads
Mamp Turn On Error Reporting
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack php enable error reporting ini_set Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign php enable error reporting on page up Why MAMP doesn't display errors? up vote 21 down vote favorite 9 OK this is getting very frustrating. MAMP used to display errors but then stopped. I decided to do a fresh install of it as I couldn't figure it
Mamp Show Errors
out. I check my PHP version, running 5.4.4 and go to that folder and change the php.ini to this: error_reporting = E_ALL display_errors = On Still no errors showing. I go through all the folders and change all php.ini files, just in case. Nothing. I fix the forced error and dump out phpinfo(), check the error section and display_errors is Off. What the hell. I place error_reporting(E_ALL); ini_set('display_errors', 'on'); at the start of the PHP file and phpinfo() again. Local value is now
Mamp Display Php Errors
On, master is still Off. Force a PHP error, and still get Server Error not PHP error. Anybody have any insight? I have a bug somewhere in some code and cannot find it, would love for PHP to just tell me. php error-handling mamp share|improve this question edited Feb 28 '15 at 15:31 kenorb 21.4k8151123 asked Jan 29 '13 at 11:06 Alex McCabe 4741618 add a comment| 7 Answers 7 active oldest votes up vote 43 down vote accepted MAMP sets up a few different php.ini files for the server, the client etc. Check in your phpinfo() which php.ini actually is read. Looks like you're editing the wrong one. share|improve this answer answered Jan 29 '13 at 11:38 pduersteler 7,61743875 2 Thank you, I had no idea. MAMP was reading from /MAMP/bin/php/5.4.4, I was editing /MAMP/conf/php/5.4.4. What a pain! –Alex McCabe Jan 29 '13 at 11:45 That also bugged me a month ago or so... ;-) –pduersteler Jan 29 '13 at 13:18 1 and don't forget to restart apache server after changes. :) –Edu Ruiz Jan 22 '15 at 23:22 add a comment| up vote 9 down vote If you're using MAMP PRO, you've to enable Error handling (PHP) in the UI interface which should contain at least two the main options: 'Display startup errors' and set output 'To: Display'. Display startup errors option is equivalent to display_startup_errors (in PHP) and To: Display to display_errors. See below: share|improve this answer edited Sep 14 '1
due to the http://stackoverflow.com/questions/14581460/why-mamp-doesnt-display-errors fact that, for some reason, PHP error reporting is turned off by default in MAMP. To enable error reporting: 1. Open up https://gilbert.pellegrom.me/enable-php-error-reporting-in-mamp/ /Applications/MAMP/bin/php/{your PHP version}/conf/php.ini. 2. Find display_errors = Off (around line 277) and change it to display_errors = On. 3. Restart MAMP. Voila! You should now see PHP errors. Build the Web is a weekly email roundup of the best tips, links and resources for web developers and people who love to build stuff on the web. Curated by me. Subscribe © Gilbert Pellegrom / @gilbitron
Operating systems OS X Contact Home > Operating systems > OS X > Enabling PHP Error Reporting in MAMP Published October 12, 2015 by Bo Andersen Enabling http://codingexplained.com/operating-systems/mac/enabling-php-error-reporting-mamp 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 error reporting steps below. 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. 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 enable error reporting 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. Previous Post Getting Query Parameter from URL in JavaScript Next Post Creating a Custom ZF2 Controller Plugin Bo Andersen I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out! OS X mamp os x php Be First to Comment Leave a Reply Cancel reply Your email address will not be published. Required fields are marked