在使用yii的命令符工具yiic.bat的shell命令生成控制器时产生包含以下错误的内容,导致无法使用。
解决办法是,在入口文件 index.php 顶部增加时区设置就行。
PHP Error
D:/Website/yii/yiitest/protected/views/layouts/main.php(47)
35 array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest) 36 ), 37 )); ?> 38 </div><!-- mainmenu --> 39 40 <?php $this->widget('zii.widgets.CBreadcrumbs', array( 41 'links'=>$this->breadcrumbs, 42 )); ?><!-- breadcrumbs --> 43 44 <?php echo $content; ?> 45 46 <div id="footer"> 47 Copyright © <?php echo date('Y'); ?> by My Company.<br/> 48 All Rights Reserved.<br/> 49 <?php echo Yii::powered(); ?> 50 </div><!-- footer --> 51 52 </div><!-- page --> 53 54 </body> 55 </html>