webapp problem on Ubuntu server

Hi, all. I run yiic webapp command without problem. However, when I opened the URL http://localhost/testdrive appears the following message:

PHP error

Description

date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CDT/-5.0/DST’ instead

Source File

/var/www/testdrive/protected/views/layouts/main.php(47)

00035: array(‘label’=>‘Logout (’.Yii::app()->user->name.’)’, ‘url’=>array(’/site/logout’), ‘visible’=>!Yii::app()->user->isGuest)

00036: ),

00037: )); ?>

00038: </div><!-- mainmenu -->

00039:

00040: <?php $this->widget(‘zii.widgets.CBreadcrumbs’, array(

00041: ‘links’=>$this->breadcrumbs,

00042: )); ?><!-- breadcrumbs -->

00043:

00044: <?php echo $content; ?>

00045:

00046: <div id="footer">

00047: Copyright &copy; <?php echo date(‘Y’); ?> by My Company.<br/>

00048: All Rights Reserved.<br/>

00049: <?php echo Yii::powered(); ?>

00050: </div><!-- footer -->

00051:

00052: </div><!-- page -->

00053:

00054: </body>

00055: </html>

Stack Trace

#0 /var/www/testdrive/protected/views/layouts/main.php(47): date()

#1 /var/www/yii/framework/web/CBaseController.php(119): require()

#2 /var/www/yii/framework/web/CBaseController.php(88): SiteController->renderInternal()

#3 /var/www/yii/framework/web/widgets/CContentDecorator.php(78): SiteController->renderFile()

#4 /var/www/yii/framework/web/widgets/CContentDecorator.php(56): CContentDecorator->decorate()

#5 /var/www/yii/framework/web/widgets/COutputProcessor.php(45): CContentDecorator->processOutput()

#6 /var/www/yii/framework/web/CBaseController.php(199): CContentDecorator->run()

#7 /var/www/yii/framework/web/CBaseController.php(294): SiteController->endWidget()

#8 /var/www/testdrive/protected/views/layouts/column1.php(7): SiteController->endContent()

#9 /var/www/yii/framework/web/CBaseController.php(119): require()

#10 /var/www/yii/framework/web/CBaseController.php(88): SiteController->renderInternal()

#11 /var/www/yii/framework/web/CController.php(741): SiteController->renderFile()

#12 /var/www/testdrive/protected/controllers/SiteController.php(32): SiteController->render()

#13 /var/www/yii/framework/web/actions/CInlineAction.php(32): SiteController->actionIndex()

#14 /var/www/yii/framework/web/CController.php(300): CInlineAction->run()

#15 /var/www/yii/framework/web/CController.php(278): SiteController->runAction()

#16 /var/www/yii/framework/web/CController.php(257): SiteController->runActionWithFilters()

#17 /var/www/yii/framework/web/CWebApplication.php(324): SiteController->run()

#18 /var/www/yii/framework/web/CWebApplication.php(121): CWebApplication->runController()

#19 /var/www/yii/framework/base/CApplication.php(135): CWebApplication->processRequest()

#20 /var/www/testdrive/index.php(13): CWebApplication->run()

Any ideas

Thanks in advance

Monico

Add this line to php.ini




date.timezone=<your timezone identifier>



or call date_default_timezone_set() from index.php (I think).

/Tommy

Yes something like…

date_default_timezone_set(‘Asia/Bangkok’);

In index.php will fix it ;)

And please search the forum before posting… this problem has already been posted/answered 2-3 times…

PHP 5.3 requires this settings that older PHP versions did not require…

Hi, all. Thanks for your reply. Yes I can fix the above problem.

Cheers

Monico