PHP 5 Disable Strict Standards Error

PHP 5 disable strict standards error

Do you want to disable error reporting, or just prevent the user from seeing it? It’s usually a good idea to log errors, even on a production site.

# in your PHP code:
ini_set('display_errors', '0'); # don't show any errors...
error_reporting(E_ALL | E_STRICT); # ...but do log them

They will be logged to your standard system log, or use the error_log directive to specify exactly where you want errors to go.

Disabling Strict Standards in PHP 5.4

As the commenters have stated the best option is to fix the errors, but with limited time or knowledge, that's not always possible. In your php.ini change

error_reporting = E_ALL

to

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

If you don't have access to the php.ini, you can potentially put this in your .htaccess file:

php_value error_reporting 30711

This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

If you don't have access to the .htaccess file or it's not enabled, you'll probably need to put this at the top of the PHP section of any script that gets loaded from a browser call:

error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);

One of those should help you be able to use the software. The notices and strict stuff are indicators of problems or potential problems though and you may find some of the code is not working correctly in PHP 5.4.

How to eliminate php5 Strict standards errors?

One of the changes in php 5.4 is that E_STRICT is now part of E_ALL

So, in your /cake/bootstrap.php you could remove the E_STRICT from your error reporting:

error_reporting(E_ALL ^ E_STRICT);

and be compatible again with before 5.4 versions.

XAMPP turn off Strict Standards errors

I'd change this line

error_reporting = E_ALL | E_STRICT

to the production Production Value

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

You can also change the display_errors settings which will allow you to log errors, but not display them

display_errors = Off

Unable to turn off strict standards warnings, XAMMP, PHP 5.4.7

It's possible that this third-party software you mention overrides the error reporting level itself after you and therefore "wins". Check for this and if that's what happens, configure it appropriately or make sure to override the settings last.



Related Topics



Leave a reply



Submit