ãCakePHPãã使ã£ã¦ã¿ã ã2ã ãCakePHPãããããã¤ã³ã¿ã¼ãããã«å°å ¥
ãFast CakePHPãã§ç´¹ä»ããã¦ãããµã³ãã«ããããã¤ã³ã¿ã¼ãããã«å°å ¥ãã¦ã¿ããã¨ã«ã
ããããã¤ã³ã¿ã¼ããããã®ãã¬ãã¢ã ãã©ã³ããã«ããã¡ã¤ã³ã§ä½¿ç¨ãã¦ããã
ãCakePHPããã¤ã³ã¹ãã¼ã«
å°å
¥ããå ´æã¯ä»¥ä¸ã®ããã«ãã¦ã¿ããa
/home/theworld/www/lab/ ã®ä¸èº«ã http://lab.theworld.jp/ ã«ç¸å½ã
ãCakePHPãã®å ¬å¼ãµã¤ããã Stable çããã¦ã³ãã¼ãã
CakePHPã®ãã¹ãç¨ã« cakephp ãã£ã¬ã¯ããªãä½ã£ã¦ãããã« Fast CakePHP ç¨ã®ãã£ã¬ã¯ã㪠fast ãä½ã£ãã
- å°å ¥å : /home/theworld/www/lab/cakephp/fast/
âãã£ã¬ã¯ããªã®ä¸èº«ã
[/home/theworld/www/lab/cakephp/fast] ls -a . .htaccess cake index.php .. app docs vendors
ãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ãã¦ã¿ã
ãCakePHPããå°å ¥ãã http://lab.theworld.jp/cakephp/fast/ ã«ã¢ã¯ã»ã¹ãã¦ã¿ãã
404 ã«ãªã£ã¦ãã¾ã£ãã
mod_rewrite ã®è¨å®ãå¤æ´
解説ã«ããã¨ããã®ç»é¢ãåºãã mod_rewrite ã®è¨å®ã« RewriteBase ã追å ããããã«ã¨ã®ãã¨ã
ãããã¤ã³ã¿ã¼ãããã§ã®è¨å®ãæ¤ç´¢ãã¦ã¿ããããã©ã¼ã©ã ã«ä»¥ä¸ã®ããã«æ¸ããã¦ããã®ã§ãã®ã¾ã¾è©¦ãã¦ã¿ãã
1) cake ã¤ã³ã¹ãã¼ã«ãã©ã«ãã® htaccess ã«ã¯ã "RewriteBase /cake"ã追å ã
2) app ã® htaccess ã«ã¯ã "RewriteBase /cake/app"ã追å ã
3) app\webroot ã® htaccess ã«ã¯ã "RewriteBase /cake/app/webroot"ã追å ã
ãã¾ãåããããã ã
ãInternal Server Errorããåºãåé¡
ãã ããã®è¨å®ã§ã¤ã³ããã¯ã¹ã«ã¢ã¯ã»ã¹ããæã¯åé¡ãªãã®ã ãã©ãæ¬ã®ä½æ¥ãé²ãã¦ããã¢ã¯ã·ã§ã³ãä½ã£ã¦ããã«ã¢ã¯ã»ã¹ãã段éã§ãInternal Server Errorããåºãããã«ãªã£ã¦ãã¾ã£ãã
ãããã¤ã³ã¿ã¼ããã㧠500 ã¨ã©ã¼ãåºãã®ã¯ãPHP ãã¡ã¤ã«ã®ãã¼ããã·ã§ã³ãã755ãã«ãªã£ã¦ããå ´åãå¤ãã
ããããã¨ããããã¤ã³ããã¯ã¹ã¯åºã¦ããããã¼ããã·ã§ã³ã¯æå®ããã®ã§åé¡ã¯ãªãããã
ã.htaccessãã®è¨å®ãããããã®ã§ãããããã¨è©¦ãã¦ã¿ãã
çµæã¨ãã¦ãwebroot ã«è¨ç½®ãã htaccess ã®è¨å®ãå¤æ´ããããã¾ãåä½ããããã«ãªã£ãã
å¿ãã¦ã¾ããããã®ãã¤ã¤ãªã®ã§è¨å®ãã¡ã¢ã
/home/theworld/www/lab/cakephp/fast/.htaccess
<ifmodule> RewriteEngine on RewriteBase /cakephp/fast RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </ifmodule>
/home/theworld/www/lab/cakephp/fast/app/.htaccess
<ifmodule> RewriteEngine on RewriteBase /cakephp/fast/app RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </ifmodule>
/home/theworld/www/lab/cakephp/fast/app/webroot/.htaccess
<ifmodule> RewriteEngine On RewriteBase /cakephp/fast/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </ifmodule>
ãã«ããã¡ã¤ã³ã§ã® RewriteBase æå®ãããããããªãã¦æéãããã£ã¦ãã¾ã£ãã