今日の人気記事

  1. ファイル名を変更 - ファイルを移動 - rename()
  2. PHP関数リファレンス
  3. ファイルを削除 - unlink()
  4. 変数の型
  5. ヒアドキュメント

CakePHP のダウンロードと初期設定

当ページのリンクには広告が含まれています。

ここでは CakePHP のダウンロードと初期設定方法を紹介します。

CakePHP のダウンロード

cakephp-download-init-01
ダウンロード!と表示されている右側にある「Download」をクリックします。

クリックすると「cakephp-2.X.X.zip」という zipファイルのダウンロードがはじまります。

ダウンロードした zipファイルを展開し、リネームしたフォルダ(例えば「cake」)を Apache の DocumentRoot ディレクトリ直下に配置します。

DocumentRoot ディレクトリはシステムによって、異なります。

MAMPの場合
/Applications/MAMP/htdocs/
XAMPPの場合
C:/xampp/htdocs/
Linuxの場合
/var/www/html/

ここでは「MAMP」環境下に「cake」フォルダを配置しました。

CakePHP の初期設定

  • http://localhost/cake

cakephp-download-init-02
すると、このような「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/Utility/Debugger.php, line 845]

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/Utility/Debugger.php, line 849]

以下のファイルを編集します。

CakePHPのフォルダ/app/Config/core.php

まず、「Security.salt」を探し、ハッシュ化するときに利用する文字列を適当に変更します。

/**
 * A random string used in security hashing methods.
 */
	Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

次に「Security.cipherSeed」を探し、暗号化/復号化するときに利用する数字を適当に変更します。

/**
 * A random numeric string (digits only) used to encrypt/decrypt strings.
 */
	Configure::write('Security.cipherSeed', '76859309657453542496749683645');

「core.php」ファイルの変更を保存し、ページを更新すると

cakephp-download-init-03
このように「Notice」が表示されなくなります。

これで初期設定完了です。

CakePHP の人気記事

まだデータがありません。

関連記事(一部広告含む)