cakePHP初心者勉強会の備忘録; cakePHPを使えるようにするまで。

今日は@mon_sat氏のご厚意で、cakePHP初心者勉強会をコワーキングスペース恵比寿で開催。フレームワークについての考え方や心構え、知識などの講義の後、使用環境の設定と、bakeを行うところまでを行った。

途中、仕事の電話が入ってしまった為、ところどころ聞けなかったところがあるが、この記事はわかっている範囲の備忘録。近いうちに復習して、環境の準備をbakeまでを行えるようにしておこうと思う。

目次

cakePHPフォルダへのアクセス

cakePHPの日本語公式サイトからcakePHP1.3バージョンをダウンロード。回答したフォルダにローカルに設置した後、そのフォルダにアクセス。

CakePHP: 高速開発 php フレームワーク。 Home

すると、下記の様なエラーが発生。

CakePHP: the rapid development php framework: Home

Warning (2): strtotime() [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 \'Asia/Tokyo\' for \'JST/9.0/no DST\' instead [CORE/cake/libs/cache.php, line 597]
Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/cakephp-002/cake/libs/cache/file.php on line 262

Fatal error: Call to a member function cd() on a non-object in /Applications/MAMP/htdocs/cakephp-002/cake/libs/cache/file.php on line 262

Warningの解決方法 Timezoneの設定

下記のフォルダにある”core.php”ファイルについて

config

約248行あたりにある、下記の部分について記述を変更

core.php

この状態でブラウザをリロード。すると、次の様な画面。

CakePHP: the rapid development php framework: Home

これの対応。

Noticeの対応方法 Security.saltの変更

Noticeは下記の通り、

Notice (1024): Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application [CORE/cake/libs/debugger.php, line 694]
Notice (1024): Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application [CORE/cake/libs/debugger.php, line 698]

CORE/cake/libs/debugger.phpファイルにある、’Security.salt’ と’Security.cipherSeed’の値を変更しろとのこと。まずはファイルをオープン

libs

694行のSecurity.saltと698行のSecurity.cipherSeedの値を変更。変更は、もともとの数字をいくつか削除することでOK。

>> @mon_satさんよりご指摘いただきました。修正するのは、app/config/core.phpのファイルです。
 

debugger.php — cakephp-002

これを↓ こうする

debugger.php — cakephp-002

これでNoticeは解決。

ブラウザをリロードすると、

CakePHP: the rapid development php framework: Home

database設定ファイルの準備

config

database.php.default これを → database.php

ブラウザをリロード。

CakePHP: the rapid development php framework: Home

Cake is NOT able to connect to the database.ということで、次はdatabaseへの接続設定をする。

ということで、今日はここまで。