2

I download absolutely new, the last version of MAMP 3.5.

I go to phpInfo and it says the PHP version is 7.0.0 and Configuration File (php.ini) Path is: /Applications/MAMP/bin/php/php7.0.0/conf.

I go to php.ini in that path and change errors to on: display_errors = On. I check that: error_reporting = E_ALL.

I Stop Servers and Start Servers. I reload the page in the browser. I check phpInfo and now display_errors is on.

I do not see the errors.

I have checked all the solutions in the web, just to name a few: MAMP Config help, display PHP errors
Why MAMP doesn't display errors? how to display errors on MAMP?

I tried everything and I do not see PHP errors. What else can I do?

11
  • try checking whether you have mentioned error_reporting(0); somewhere in your source code. Commented Jan 16, 2016 at 14:37
  • Did you check "Log error: to screen' in MAMP -> tab "PHP"? Commented Jan 16, 2016 at 14:40
  • 1
    What errors do you expect to be shown where? Commented Jan 16, 2016 at 14:53
  • 1
    If that's the only thing in the file, it's not an error. Commented Jan 16, 2016 at 14:57
  • 1
    Again, if it's the only thing in the file, it's fine. The last statement in a file does not require to be terminated by ;, it'll be implicitly terminated by the end of the file. Try it with a simpler and less ambiguous error, like echo $someUndefinedVariable;. Commented Jan 18, 2016 at 8:49

2 Answers 2

4

Preface your PHP code with this. It will force error display.

ini_set('display_errors', 'On');
error_reporting(E_ALL);

Also check your .ini files in the following locations:

Applications/MAMP/bin/php/(PHP version)/conf/php.ini

Applications/MAMP/conf/php/(PHP version)/conf/php.ini

They should both be set for:

display_errors = On

EDIT: I should clarify this, as it may be a point of confusion: You should restart your MAMP server when the changes are complete.

Sign up to request clarification or add additional context in comments.

3 Comments

See my update. You may need to edit an additional .ini file
I did it and I checkec again and I see no errors. (by the way, the second path I have it here: Applications/MAMP/conf/(PHP version)/php.ini
Did you restart your MAMP server?
0

I changed my .ini files located as Bangkoian stated above. In MAMP PRO 3.5 there is an additional or third .ini file that needs to be changed.

This file can only be accessed through the MAMP Pro File menu . I'm not sure where it actually is in the actual file structure.

Access the .ini by: Command +4 or File > Edit Template > PHP > Version Your using

Find around line 271:

error_reporting  =  MAMP_error_reporting_MAMP

and change to E_ALL

error_reporting  =  E_ALL

under error_reporting look for display_errors and change:

display_errors = MAMP_display_errors_MAMP

and change to On

display_errors = On

You'll end up needing to change these line in 3 Different places

Applications/MAMP/bin/php/(PHP version)/conf/php.ini
Applications/MAMP/conf/php/(PHP version)/conf/php.ini

and through MAMP Pro itself: Command +4 or File > Edit Template > PHP > Version Your using

After the third method was added it worked as expected, I'm also using PHP 7. Make sure Debugger Activate Xdebug it checked under the PHP tab.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.