2013-02-01 31 views

回答

1

要顯示你的PHP腳本造成的,您可以包括這些代碼行的錯誤消息:

ini_set('display_errors',1); 
error_reporting(E_ALL); 
1

使用以下error_reporting()功能設置啓用的錯誤。

<?php 

    // Report simple running errors 
    error_reporting(E_ERROR | E_WARNING | E_PARSE); 

    // Reporting E_NOTICE can be good too (to report uninitialized 
    // variables or catch variable name misspellings ...) 
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); 

    // Report all errors except E_NOTICE 
    // This is the default value set in php.ini 
    error_reporting(E_ALL^E_NOTICE); 

    // Report all PHP errors (see changelog) 
    error_reporting(E_ALL); 

    // Report all PHP errors 
    error_reporting(-1); 

    // Same as error_reporting(E_ALL); 
    ini_set('error_reporting', E_ALL); 

    ?> 
+1

你也可以在'.htaccess'中設置它們。例如,「php_value error_reporting 0」 –

2
php_value error_reporting 0 
php_flag display_errors Off 
相關問題