CakePHPをインストールする
使用した環境
- PHP Version 5.2.1
- FedoraCore 6
- MySQL 5.0
参考にした書籍
- 作者: 秋田真宏
- 出版社/メーカー: 技術評論社
- 発売日: 2008/01/08
- メディア: 単行本(ソフトカバー)
- クリック: 106回
- この商品を含むブログ (22件) を見る
インストールする
- CakePHP: the rapid development php framework. Pages
- DownloadからNo Thanksを選択する
- 使ったのは、Version 1.1系(最新は1.2系みたいですね)
設置
今回はとりあえず、下記に、圧縮ファイルを展開してみました。
展開したディレクトリ
/usr/local/httpd/htdocs/cake
展開したファイル
.htaccess app cake docs index.php vendors
キャッシュディレクトリに書込み権限を与える
- /usr/local/httpd/htdocs/cakeで作業
- app/tmp以下にはいろいろなディレクトリがあるので、一気に設定
chmod -R 707 app/tmp/
MySQL
データベースを用意します
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.37-log Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database cake default character set utf8 collate utf8_general_ci; Query OK, 1 row affected (0.01 sec)
- ユーザーを用意します
grant select,insert,update,delete,create,index,alter on cake.* to cake@localhost identified by 'cakepassword';
CakePHP側のデータベース設定
設定ファイルを用意する
$ pwd /usr/local/httpd/htdocs/cake/app/config $ cp database.php.default database.php