CakePHPを使う

1.ダウンロード

以下のサイトから、CakePHPのファイルをダウンロードする。

今回は、1.3系を使用。

2.CakePHPをインストール

ダウンロードしたファイルを解凍し、apacheへ配置。

3.設定

3.1. .htaccessを作成する。

以下の内容で、.htaccessを作る。

---------------------------------------------------------------

<IfModule mod_rewrite.c>

    RewriteEngine    on

    RewriteBase      /phpPrj

    RewriteRule      ^$ app/webroot/ [L]

    RewriteRule      (.*) app/webroot/$1 [L]

</IfModule>

---------------------------------------------------------------

 

3.2.ディレクトリと配下のファイルのパーミッションの設定

$ cd /Applications/XAMPP/htdocs/phpPrj/app/

$ chmod -R 777 tmp/

 

3.3. core.phpの修正

./phpPrj/app/config/schema/core.phpを開く

 

204行目付近の”Security.salt”と、208行目付近の"Security.cipherSeed"を変更する。

(下記の太字の部分が変更対象)

------------------------------------------------------------

/**

 * A random string used in security hashing methods.

 */

Configure::write('Security.salt', 'test_php_cake_prj');

/**

 * A random numeric string (digits only) used to encrypt/decrypt strings.

 */

Configure::write('Security.cipherSeed', '123456789098765456789987678777');

------------------------------------------------------------

 

3.5. 確認

http://localhost/phpPrj/へアクセスし、以下の画面が表示されることを確認する。

 

動作確認画面
動作確認画面

※データベースの設定はしていないので、下記の表示は残る。

----------------------------------------------------------------

Your database configuration file is NOT present.

Rename config/database.php.default to config/database.php

----------------------------------------------------------------

 

4.参考にしたサイト

写真素材のピクスタ