2

For some reason, MAMP won't allow me to turn off E_STRICT warnings. I've tried everything from changing the value explicitly in php.ini to error_reporting(E_ALL & ~E_STRICT) in my file... to explicitly saying php_ini('error_reporting', E_ALL & ~E_STRICT). I'm entirely confused as to why this is happening, and from what I can tell its specific to MAMP.

The version of PHP I'm running is 5.2.13 - and before you start telling me I shouldn't be ignoring those warnings, lets just be clear that I am using a framework that requires that E_STRICT be ignored. (lame, I know.)

1
  • 1
    I am having the same issue. Tried adding in htaccess and event using error_reporting(); in index.php Nothing worked. @Mark37 please post the solution.
    – kck
    Jul 12, 2012 at 11:16

3 Answers 3

3

Try editing your php.ini (line 270)

error_reporting  =  E_ALL & ~E_STRICT

If that fails, try it by editing the .htaccess file in the root-folder

php_value error_reporting 6143

If even that fails, look for the line 'display_errors = Off' and change it to:

display_errors = Off

Be careful, sometimes there is more then one occurrence.

4
  • E_STRICT isn't even listed as an option in php.ini, and setting the value manually just seems to ignore it.
    – Mark G.
    Feb 23, 2011 at 23:33
  • Hmmm, Ok... Maybe MAMP changed something to it... Try the edit above. Feb 24, 2011 at 0:35
  • Have you confirmed that you are editing the correct php.ini using phpinfo(); ? Jul 12, 2012 at 11:23
  • 1
    The solution really is editing the right .ini file, and phpinfo() was spot on!, I just edited the right ini and it solved my problem, thanks!
    – jackJoe
    Feb 3, 2013 at 12:01
0
  1. Make sure you are editing the correct php.ini by checking with phpinfo();

  2. Make sure you restart apache to apply the new settings

... Only suggesting these since they are not explicitly stated in the question, but you've probably done both.

1
  • Although now I see that you tried php_ini function... Jul 12, 2012 at 12:04
0

Ok so I've found a solution for this.
I had exactly the same problem and this is how I've fixed it:

1) create a vhost in MAMP (not sure if necessary but this way it works)
2) inside the vhost config, you add this line:

php_admin_value error_reporting 6143

Notice its php_admin_value instead of php_value ? This changes everything!

3) restart MAMP and profit!

Not the answer you're looking for? Browse other questions tagged .