php, no puedo hacer que aparezcan advertencias en mi servidor de prueba, pero ¿en el archivo de registro en mi servidor isps?

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

tambien tengo

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

3 Respuestas

Kit display_errors a On to display the warnings in the page (instead of in the logfile) and set error_reporting a E_ALL | E_STRICT to display all warnings and errors in your php.ini.

Respondido el 09 de enero de 11 a las 15:01

@Jules If you had that, all warnings would show. Please make absolutely sure you're editing the right php.ini by creating a new file with the content <?php echo $x; phpinfo(); and checking that it 1. results in a warning 2. has the values for display_errors and error_reporting you expect. - Phihag

Yes it the correct one, I've copied my phpinfo to a htm and uploaded on a different site ... Maybe that will help - Jules

@Jules As you can see in that phpinfo output, the settings are no es correct: display_errors is set to DESC en lugar de On. - Phihag

No Change.... Current phpinfo and that echo's... still not getting any warnings on the page or the error file... - Jules

@Jules if you look on the updated phpinfo output, you'll see the warnings (search for "Strict Standards"). However, it's puzzling that the first line (echo $x) does not result in an error message. Can you try introducing a "bigger" error, like for{ or so? Also, on a completely unrelated note, you may want to update to php5.3 later. - Phihag

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');

Be sure to use these only for development environments only.

Respondido el 09 de enero de 11 a las 15:01

I have that already, I have it on both test and live servers and no warnings show, just notices. But the warnings show in the log file on the live server. - Jules

Leave error_log blank and see what happens. I said log_errors should be off earlier... leave it on. - Estándar

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__;

Respondido el 09 de enero de 11 a las 15:01

Current phpinfo and that echo's... errlevel was: 6143 before setting to all.... still not getting any warnings on the page or the error file... - Jules

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.