Visualizzazione dei risultati da 1 a 6 su 6

Discussione: errore STRICT

  1. #1

    errore STRICT

    il php mi spara questo errore

    Undefined variable: inside_mod in c:\websites\mysite\mainfile.php

    ho appena installato php 5.0.1 su win ma mi sembra assurdo che sia cosi rigido da segnalare una variabile non inizializzata (c'era anche display_errors = Off), sapete se da php.ini si puo intervenire perche sia meno rompipalle?

    grazie
    Manuel

    View my profile on LinkedIn
    Ubertini: amo solo te!

  2. #2
    Utente di HTML.it L'avatar di Pasco
    Registrato dal
    Apr 2002
    Messaggi
    1,559
    prova a dare uno sguardo al php.ini , ci sono moltissimi esempi ben commentati

    se vuoi un php che ti 'conceda' molto , prova ad usare questo error reporting:

    codice:
    error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
    cmq sia è sempre meglio abituarsi a scrivere codice con E_ALL
    PyFanatics

  3. #3
    Originariamente inviato da Pasco
    prova a dare uno sguardo al php.ini , ci sono moltissimi esempi ben commentati

    se vuoi un php che ti 'conceda' molto , prova ad usare questo error reporting:

    codice:
    error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
    cmq sia è sempre meglio abituarsi a scrivere codice con E_ALL
    sono daccordo con te ma non è opera mia bensì il mitico phpnuke :-/

    senti il tuo suggerimento è OK ma mi da una pagina bianca, forse questo agisce su diplay_errors?

    ho anche provatp ~E_ALL ma stesso risultato...
    Manuel

    View my profile on LinkedIn
    Ubertini: amo solo te!

  4. #4
    Utente di HTML.it L'avatar di Pasco
    Registrato dal
    Apr 2002
    Messaggi
    1,559
    nel modo che ti ho segnalato , php ti segnala tutti gli errori eccetto i notice e i warning del codice. ti cito direttamente il php.ini:

    codice:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_STRICT          - run-time notices, enable to have PHP suggest changes
    ;                     to your code which will ensure the best interoperability
    ;                     and forward compatability of your code
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices and coding standards warnings
    ;
    ;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors
    ;
    PyFanatics

  5. #5
    ok è chiaro

    io ho provato con ~E_ALL che dovrebbe far andare diritto anche con errori invece mi da pagina bianca... sembra esserci un altro errore che però non vedo... infatti la spiegazione dei parametri che mi hai segnalato dice:
    ; error_reporting is a bit-field. Or each number up to get desired error
    ; reporting level

    questi parametri piu che rendere il php meno "fiscale" agiscono sulle modalita di segnalazione degli errori...
    Manuel

    View my profile on LinkedIn
    Ubertini: amo solo te!

  6. #6
    Utente di HTML.it L'avatar di Pasco
    Registrato dal
    Apr 2002
    Messaggi
    1,559
    prova con E_ALL , ovvero senza la tilde
    PyFanatics

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.