dongtan7201 2016-06-25 20:57
浏览 23

Yii框架1如何再次显示漂亮的框架错误?

I remember that yii used to show nice errors with an awesome stacktrace. How do I get a helpful error again? Now I get rather unhelpful framework errors (as xdebug does well for php errors) like this:

Error 404

The system is unable to find the requested action "symbols".

No line number, no trace.

error.php:

<?php
/* @var $this SiteController */
/* @var $error array */

$this->pageTitle=Yii::app()->name . ' - Error';
$this->breadcrumbs=array(
    'Error',
);
?>

<h2>Error <?php echo $code; ?></h2>

<div class="error">
<?php echo CHtml::encode($message); ?>
</div>
  • 写回答

2条回答 默认 最新

  • douyin7416 2016-06-26 07:43
    关注

    be sure in you app\index.php you have a proper YII_DEBUG configuration

    // remove the following lines when in production mode
    defined('YII_DEBUG') or define('YII_DEBUG',true);
    // specify how many levels of call stack should be shown in each log message
    defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); // development configuration 
    //defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0); // production configuration 
    
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统