アーカイブ

‘フレームワーク’ カテゴリーのアーカイブ

CakePHPに手を出してみた。

2009 年 2 月 26 日 少佐 コメント 4 件

つっても、まだインストールしただけだけど(←

・・・というわけで、ブログ放置してました。最近だらけ気味な少佐です。

それでも何故か少しだけアクセスはあったんですね。(ソースはGoogleAnalytics)
何かもーホント・・・

暇人っすね

・・・じゃなくて、ありがとうございます、ハイ。

それはさておき、手始めにインストールするまでにした事を適当に書き連ねてみようかと。

1.公式でダウンロード

これは言わずもがな。

2.XAMPPのlocalhostに入れる

本当ならここで解凍したフォルダを丸ごとxampplite/htdocsディレクトリに入れる所だけど、
ウチの場合はApacheの設定をxampplite/apache/conf/extra/httpd-userdir.confで


<IfModule userdir_module>
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
#
#UserDir "My Documents/My Website"
UserDir "Y:/home/*/public_html"
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#

#<Directory C:/Documents and Settings/*/"My Documents/My Website">
#    AllowOverride FileInfo AuthConfig Limit Indexes
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>

  <Directory "Y:/home/*/public_html">
    AllowOverride All
    Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
    <Limit GET POST OPTIONS PROPFIND>
      Order allow,deny
      Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
      Order deny,allow
      Deny from all
    </LimitExcept>
  </Directory>
</IfModule>

…と、いった具合に変更してるので、フォルダの中身だけを
home/cake/public_html/ディレクトリに。

3.フォルダ内に入ってる.htaccessの変更


<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

デフォルトがこんな感じ。これを・・・


<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
   RewriteBase /~cake
</IfModule>

・・・と、いった感じに変更。

4.動作確認

最後にブラウザからhttp://localhost/~cake/にアクセス。

cake_php

上の画像みたいなページが出たら、成功だそうです。

・・・ってな感じで、次の日曜辺りにでも本格的にCakePHPに触ってみるよ!よ!

ああ、そうそう。どうでも良いけど、新しいPC買いました。
やっぱCore2&メモリ4GBは快適だね!