CakePHP
とりあえずインストール方法。相変わらず環境はWindowsです。さらにApache2+MySQLです。PHPとMySQLはすでに使える状態だとしてます。
- ファイルのダウンロード。https://trac.cakephp.org/wiki/Cake/Download から0.9.1をダウンロード。Winなのでzipファイルを選択。
- ファイルを解凍してd:\cake に入れる
- Apacheの設定(mod_reqriteを使うのでその設定)
#LoadModule rewrite_module modules/mod_rewrite.so ↓ LoadModule rewrite_module modules/mod_rewrite.so 以下を適当なとこに追加 Alias /cake "D:/cake/"DirectoryIndex index.php Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all
ポイントは「FollowSymLinks」を追加すること。AllowOverrideを有効にすることです。
- .htacessの編集2つ。これはインストールフォルダを任意の場所にしたために必要な設定です。docrootの下に入れた場合は必要ないと思います。
D:\cake\.htacess
#「RewriteBase /cake」を追加RewriteEngine on RewriteBase /cake RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L]
D:\cake\public\.htacess
#「RewriteBase /cake/public」を追加# Redirect all requests not available on the filesystem to Cake RewriteEngine On RewriteBase /cake/public RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] # In case Cake experiences terminal errors ErrorDocument 500 500.html
- http://localhost/cake/ にアクセスして「Cake PHP works!」というページが開けばOK!