Disable notice yii

13,435

Update public/index.php

<?php
define('YII_ENABLE_ERROR_HANDLER', false);
define('YII_ENABLE_EXCEPTION_HANDLER', false);

// Turn off all error reporting
// error_reporting(0);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
Share:
13,435
user2420249
Author by

user2420249

Updated on June 14, 2022

Comments

  • user2420249
    user2420249 almost 2 years

    How disable notice , i try in idex.php But Notice is echo , how i can disable this .

    <?
        define("YII_ENBLE_ERROR_HANDLER",false)
        define("YII_ENBLE_EXCEPTION_HANDLER",false)
    ?>
    

    in php.ini

    <?display_errors = off ?>
    
  • Valery Viktorovsky
    Valery Viktorovsky almost 11 years
    Add define('YII_ENABLE_ERROR_HANDLER', false) to index.php and then set error reporting.
  • user2420249
    user2420249 almost 11 years
    Notice: Undefined property: stdClass::$edited in E:\web\domains\cabinet\protected\views\timeshares\index.php on line 34
  • Valery Viktorovsky
    Valery Viktorovsky almost 11 years
    You should disable YII_ENABLE_ERROR_HANDLER in public/index.php, not in app/views/timeshares/index.php
  • user2420249
    user2420249 almost 11 years
    this is my index.php <?php // change the following paths if necessary $yii=dirname(FILE).'/framework/yii.php'; $config=dirname(FILE).'/protected/config/main.php'; defined('YII_DEBUG') or define('YII_DEBUG',false); // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); define('YII_ENABLE_ERROR_HANDLER',false); define('YII_ENABLE_EXCEPTION_HANDLER',false); error_reporting(0); error_reporting(E_ALL ^ E_NOTICE); require_once($yii); Yii::createWebApplication($config)->run();
  • Admin
    Admin almost 11 years
    There is a type in your answer, cant edit because one character: YII_ENBLE_EXCEPTION_HANDLER should be YII_ENABLE_EXCEPTION_HANDLER - same typo is in question