FuelPHPのインストールから設定まで
FuelPHPのインストール
環境はLAMP。
公式ページにあるとおり、(http://press.nekoget.com/fuelphp_doc/installation/instructions.html)
下記実行。
$ curl get.fuelphp.com/oil | sh $ cd <作業フォルダ> $ oil create <project_name>
create時に”date_default_timezone_get()”エラーが起きた。
date_default_timezone_get()エラー
apacheの現在日時確認
$ date
設定出来ている。
phpのタイムゾーン設定確認
vim /etc/php.ini
コメントアウトされていた。原因これだな。
以下の通り設定
date.timezone = "Asia/Tokyo"
再度oil create して無事完了。
500エラー
ブラウザで PROJECTNAME/public/ を開くと 500エラー。
apacheのエラーログをみると .htaccess で弾かれているっぽい。
/home/******/PROJECTNAME/public/.htaccess: Options not allowed here
参考ページ(http://reuben625.blogspot.jp/2013/04/fuelphp.html)見つつ、
PROJECTNAME/public/.htaccess の
Options +FollowSymLinks -Indexes
をコメントアウト
fatal error
参考ページ同様に下記 fatal error。
Fatal error: Uncaught exception 'Fuel\Core\PhpErrorException' with message 'date() [<a href='function.date'>function.date</a>]: 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 'Asia/Tokyo' for 'JST/9.0/no DST' instead' in /home/hoge/fuel/packages/log/classes/log.php:51 Stack trace: #0 /home/hoge/fuel/core/bootstrap.php(54): Fuel\Core\Error::error_handler(2, 'date() [<a href...', '/home/hoge...', 51) #1 [internal function]: {closure}(2, 'date() [<a href...', '/home/hoge...', 51, Array) #2 /home/hoge/fuel/packages/log/classes/log.php(51): date('Y/m') #3 [internal function]: Log\Log::_init() #4 /home/hoge/fuel/core/classes/autoloader.php(364): call_user_func('Log::_init') #5 /home/hoge/fuel/core/classes/autoloader.php(247): Fuel\Core\Autoloader:: in /home/hoge/fuel/packages/log/classes/log.php on line 51
Fuelプロジェクト自体のタイムゾーン設定がコメントアウトされているので、
fuel/app/config/config.php に
'default_timezone' => 'Asia/Tokyo',
を設定。
できた
やっとwelcomeページにたどり着けましたー。