Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: mysqlway en 20 Diciembre 2014, 19:42 pm



Título: Warning omitir el aviso en php
Publicado por: mysqlway en 20 Diciembre 2014, 19:42 pm
Hola,

Quiero omitir los mensajes de Notificaciones y warning de php.

HE conseguido omitir las notificaciones pero me sigue apareciendo un mensaje así:

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\xampp\htdocs\TUG\ficha.php on line 212

Estoy configurando el ini pero con estos parámetros no me lo omite qué puede faltar?

; display_errors
;   Default Value: Off
;   Development Value: Off
;   Production Value: Off



; error_reporting
;   Default Value: E_ALL  & ~E_NOTICE  & ~E_WARNING
;   Development Value: E_ALL & ~E_NOTICE  & ~E_WARNING
;   Production Value: E_ALL   & ~E_WARNING & ~E_STRICT & ~E_NOTICE



; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting: E_ALL  & ~E_NOTICE & ~E_WARNING around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval: E_ALL & ~E_WARNING


Título: Re: Warning omitir el aviso en php
Publicado por: MinusFour en 20 Diciembre 2014, 19:51 pm
Lo que has puesto son comentarios, no hay ninguna configuracion reflejada en lo que has puesto. Observa mi configuracion, la ultima linea no tiene ';' lo demas si (son comentarios).

Código
  1. ; This directive controls whether or not and where PHP will output errors,
  2. ; notices and warnings too. Error output is very useful during development, but
  3. ; it could be very dangerous in production environments. Depending on the code
  4. ; which is triggering the error, sensitive information could potentially leak
  5. ; out of your application such as database usernames and passwords or worse.
  6. ; For production environments, we recommend logging errors rather than
  7. ; sending them to STDOUT.
  8. ; Possible Values:
  9. ;   Off = Do not display any errors
  10. ;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
  11. ;   On or stdout = Display errors to STDOUT
  12. ; Default Value: On
  13. ; Development Value: On
  14. ; Production Value: Off
  15. ; http://php.net/display-errors
  16. display_errors = Off

Tambien asegurate que estes modificando el php.ini correcto.

Otra cosa que puedes usar es ponerle un @ a las lineas que arrojan warnings:

Código

http://php.net/manual/en/language.operators.errorcontrol.php