PHP error_reporting not working?
If PHP is ignoring your error_reporting directives, try the following;
ini_set('error_reporting', E_ALL);
ini_set('display_startup_errors', 1);
ini_set("log_errors",1);
ini_set("display_errors",1);
ini_set("error_log", "/path/to/a/log/file/php_error.log"); // make sure this is chmodded to 0777 permissions
Still not working? Like it wasn’t for me? Well save yourself 20 hours debugging and make sure if you’re using include() or require() for the script you’re working in that you aren’t force suppressing all errors like this;
@include("/path/to/my/file/no_errors.php");
I put the @ sign because I wanted to supress any “file not found” errors, but without realising it, was forcing supression of ALL errors inside the script as well. GAH!
Loading...
