This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

【CakePHP速習会】CakePHPを準備する

Last updated at Posted at 2016-07-03

1. CakePHPをダウンロードする

1-1. 以下のサイトより2.Xの最新版をダウンロードする
https://github.com/cakephp/cakephp/tags

今回は2.8.5を使用します。
image

※ ダウンロードではなく、cloneする場合

git clone -b 2.8.5 https://github.com/cakephp/cakephp.git

1-2. ダウンロードしたCakePHPを、Vagrantを起動しているディレクトリに移動する。

.../dip-vagrantfile-master/cakephp/

image

2. 確認(1)

ブラウザで見てみる
http://192.168.33.10/cakephp

WS000000.JPG

3. CakePHPの追加の設定をやる

下記のページを参考に「追加の設定」をやる
http://book.cakephp.org/2.0/ja/tutorials-and-examples/blog/blog.html#id4

  • timezoneを設定する。(275行目付近)
/cakephp/app/Config/core.php
/**
 * Uncomment this line and correct your server timezone to fix
 * any date & time related errors.
 */
    //date_default_timezone_set('UTC');
    date_default_timezone_set('Asia/Tokyo');
  • Security.salt を変更する(228行目付近)
/cakephp/app/Config/core.php
/**
 * A random string used in security hashing methods.
 */
    //Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
    Configure::write('Security.salt', 'pl345e-P45s_7h3*S@l7!');
  • Security.cipherSeed を変更する(235行目付近)
/cakephp/app/Config/core.php
/**
 * A random numeric string (digits only) used to encrypt/decrypt strings.
 */
    //Configure::write('Security.cipherSeed', '76859309657453542496749683645');
    Configure::write('Security.cipherSeed', '7485712659625147843639846751');

4. 確認(2)

ブラウザをリロードする
http://192.168.33.10/cakephp

WS000001.JPG

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up