I'm trying to get the warnings to show in my php error log. My ISP has some warnings showing and I need to be able to see them on my test server.
error_reporting = E_ALL & ~E_NOTICE display_errors = off display_startup_errors = Off log_errors = On error_log = "C:\php-errors.txt"
I've upgraded my php version too 5.2.17
register_globals = Off
Like my ISP, but I can't get any warnings to show.
preguntado el 09 de enero de 11 a las 12:01
On to display the warnings in the page (instead of in the logfile) and set
E_ALL | E_STRICT to display all warnings and errors in your
ini_set('display_errors', 'on'); is a great way to change php configurations settings specific for that page only. Include it in a global header/initialization file to make it application specific. Also, as mentioned before error_reporting(E_ALL); is good for this too.
Code at the top your scripts:
ini_set('display_errors', 'on'); error_reporting(E_ALL);
Be sure to use these only for development environments only.
If you want to show all possible warnings, try
error_reporting(-1);, or you can put
error_reporting = -1 into the php.ini file on your test server. It works, because the internal variable is used as a bit-field, and -1 sets all the bits on, hence, showing all possible errors.
To make sure that the error_reporting is still set to what you think, the variable returns the currently set level.
$prevErrLevel = error_reporting(-1); echo "errlevel was: $prevErrLevel before setting to all.", __FILE__,':',__LINE__;