最終更新:
tomoedrive 2011年05月19日(木) 15:32:53履歴
ランキング系のゲームを作りたくて、データ蓄積しなくちゃいけないので
どうせだからcakePHPでも使ってみようと思ったので入れてみる事にした。
DBも使い慣れているposgresを使う事にする。
ってことで設定アレコレ
【前提条件】
1.下記のURLからcackePHP1.3.8を入手する。
http://cakephp.jp/
![](https://image01.seesaawiki.jp/t/e/tomoedrive/19c66903030ffc93.JPG)
2.取得したzipファイルを解答しディレクトリ名を”cake”に変更した後、htdocsディレクトリへ配置する。
![](https://image02.seesaawiki.jp/t/e/tomoedrive/29ee8f7b000e8c05.JPG)
3.DBの設定
「htdocs\cake\app\config」に移り
「database.php.default」ファイルを「database.php」と名前を変えてあげる。
![](https://image02.seesaawiki.jp/t/e/tomoedrive/052cf0f4ece90916.JPG)
「database.php」ファイルを開く
最下部の「class DATABASE_CONFIG」の定義を下記の用に変更する。passwordやhost,databaseは自分の環境へあわせる。
class DATABASE_CONFIG {
var $default = array(
'driver' => 'postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'postgres',
'password' => 'postgres',
'database' => 'postgres',
'encoding'=>'utf-8',
'prefix' => '',
);
var $test = array(
'driver' => 'postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'postgres',
'password' => 'postgres',
'database' => 'postgres',
'encoding'=>'utf-8',
'prefix' => '',
);
}
4.同じ階層にあるcore.phpファイルを修正する。
セキュリティハッシュメソッドの文字列を書き換えてあげる。(204行目)
Configure::write('Security.salt', 'DYXG54b0GKJfIxDs2guVoUubWwvniR2G0FgaC9mi');
乱数の値を書き換えたあげる。(209行目)
Configure::write('Security.cipherSeed', '12354304657453542496749683645');
デフォルトタイムゾーンのコメントアウトを外したげる。(248行目)
どうせだからcakePHPでも使ってみようと思ったので入れてみる事にした。
DBも使い慣れているposgresを使う事にする。
ってことで設定アレコレ
【前提条件】
- Apache2.2系をインスコ済
- PHP5系をインスコ済
- postgresをインスコ済
1.下記のURLからcackePHP1.3.8を入手する。
http://cakephp.jp/
2.取得したzipファイルを解答しディレクトリ名を”cake”に変更した後、htdocsディレクトリへ配置する。
3.DBの設定
「htdocs\cake\app\config」に移り
「database.php.default」ファイルを「database.php」と名前を変えてあげる。
「database.php」ファイルを開く
最下部の「class DATABASE_CONFIG」の定義を下記の用に変更する。passwordやhost,databaseは自分の環境へあわせる。
class DATABASE_CONFIG {
var $default = array(
'driver' => 'postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'postgres',
'password' => 'postgres',
'database' => 'postgres',
'encoding'=>'utf-8',
'prefix' => '',
);
var $test = array(
'driver' => 'postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'postgres',
'password' => 'postgres',
'database' => 'postgres',
'encoding'=>'utf-8',
'prefix' => '',
);
}
4.同じ階層にあるcore.phpファイルを修正する。
セキュリティハッシュメソッドの文字列を書き換えてあげる。(204行目)
Configure::write('Security.salt', 'DYXG54b0GKJfIxDs2guVoUubWwvniR2G0FgaC9mi');
乱数の値を書き換えたあげる。(209行目)
Configure::write('Security.cipherSeed', '12354304657453542496749683645');
デフォルトタイムゾーンのコメントアウトを外したげる。(248行目)
C:\Apache2.2\confにある(Apacheの配置場所にあるconfディレクトリ)
apacheのhttpd.confの変更する。(240行目)
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
↓
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
最後に確認
設定ファイル変更後Apacheを再起動し
下記URLへアクセスしてみるスタイルシートやjavascriptが反映されていたらOK
http://localhost/cake
こんな感じでてたら◎
apacheのhttpd.confの変更する。(240行目)
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
↓
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
最後に確認
設定ファイル変更後Apacheを再起動し
下記URLへアクセスしてみるスタイルシートやjavascriptが反映されていたらOK
http://localhost/cake
こんな感じでてたら◎
タグ
コメントをかく