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?

Community
  • 1
  • 1
Nrc
  • 9,577
  • 17
  • 67
  • 114
  • try checking whether you have mentioned error_reporting(0); somewhere in your source code. – ameenulla0007 Jan 16 '16 at 14:37
  • Did you check "Log error: to screen' in MAMP -> tab "PHP"? – Yurich Jan 16 '16 at 14:40
  • @ameenulla0007 I just have the most basic error: missing ";" – Nrc Jan 16 '16 at 14:42
  • @Yurich: I do not understand. Where is that? In Mamp > Preferences > PHP I do not see that option 'Log error: to screen' – Nrc Jan 16 '16 at 14:44
  • @Nrc [image](https://www.mamp.info/en/images/screenshots/en_multi-php.jpg) check this out at the bottom – Yurich Jan 16 '16 at 14:47
  • @Yurich: I have Mamp, no Mamp Pro – Nrc Jan 16 '16 at 14:51
  • 1
    What errors do you expect to be shown where? – deceze Jan 16 '16 at 14:53
  • @deceze I just have a simple file to test, for instance an echo without ";" echo "this is an error" – Nrc Jan 16 '16 at 14:57
  • 1
    If that's the only thing in the file, **it's not an error.** – deceze Jan 16 '16 at 14:57
  • @deceze: I followed a tutorial and there it was detected: www.youtube.com/watch?v=lY165def6Jk minute 4:26 But not me, I do not know why? – Nrc Jan 16 '16 at 16:17
  • 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;`. – deceze Jan 18 '16 at 08:49

2 Answers2

3

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.

Bangkokian
  • 6,548
  • 3
  • 19
  • 26
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.

David
  • 11
  • 2