Saturday, February 23, 2013

CakePHP AWS installation tips

昨天為了我們的Online Dating Website TraRoma.com設定好AWS instance跟LAMP的環境之後, 今天第一件事是試著在AWS上把CakePHP裝起來. 前面幾步問題不大, 就是1)下載cakephp, 2)解開cakephp到webroot裡, 3) 把app/tmp的讀寫權限設定好. 本來以為這樣就可以開始玩了(因為之前在自己laptop的Ubuntu裡這樣就夠了). 但是沒想到出現了奇怪的錯誤.

 

Warning (2): strtotime() [http://php.net/function.strtotime]: 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 'UTC' for 'UTC/0.0/no DST' instead [CORE/cake/libs/cache.php, line 597]

Notice: Trying to get property of non-object in /var/www/html/cakephp/cake/libs/cache/file.php on line 248 Fatal error: Call to a member function cd() on a non-object in /var/www/html/cakephp/cake/libs/cache/file.php on line 248

後來查了一下, 原來是app/config/core.php裡的date_default_timezone_set要設定. 有人說這是因為PHP的版本的原因造成的. (我的Ubuntu上是5.3.5, AWS上的是5.3.6). 不過把這個搞定之後, 就可以正常看到index.php的畫面了. 最後就是把URL rewriting搞定. 這部分就是照著index.php裡link到的tutorial網頁把httpd.conf設定好. 然後重開httpd就搞定了! 喔耶! 可以開始在AWS上面來烤蛋糕了!!

No comments:

Post a Comment