简体   繁体   中英

How can I disable Yii error pages?

I am moving into a production environment and the following is set:

error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', false);
defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER', false);

However, I have noticed that Yii will still show that big beautiful stack trace filled with all sorts of goodies.

I know the best way to overcome this is to actually write sound code, however, that is not always possible when dealing with mischievous individuals.

Using:

Apache/2.4.27 (Amazon) PHP/7.0.25
Yii Framework/2.0.8

Testing:

<?php
    ThisFunctionDoesNotExist();
?>

Although, everything seems to be correct, it doesnt work. I am having similar issues as this guy: http://www.yiiframework.com/forum/index.php/topic/22583-yii-debug-false-shows-php-notice-errors-and-stops/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM