{"id":2300,"date":"2012-04-12T21:54:07","date_gmt":"2012-04-12T12:54:07","guid":{"rendered":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/?p=2300"},"modified":"2012-04-17T09:22:15","modified_gmt":"2012-04-17T00:22:15","slug":"cakephpiy2","status":"publish","type":"post","link":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/2012\/04\/12\/2300\/","title":{"rendered":"CakePHP\u7df4\u7fd2(2)"},"content":{"rendered":"<p><a href=\"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/2012\/03\/12\/2265\">CakePHP\u7df4\u7fd2(1)<\/a>\u306e\u7d9a\u304d<\/p>\n<p>\u300c<a href=\"http:\/\/book.cakephp.org\/2.0\/en\/tutorials-and-examples\/blog\/blog.html\">CakePHP\u306e\u30d6\u30ed\u30b0\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u300d\u3092\u52d5\u4f5c\u3055\u305b\u308b\u4f8b\u3002\u3053\u3053\u3067\u306f\u3001CakePHP\u306e\u52d5\u4f5c\u8a2d\u5b9a\u307e\u3067\u3002<\/p>\n<p>\u307e\u305a\u3001<a href=\"http:\/\/cakephp.jp\/\">CakePHP\u3092\u5165\u624b<\/a>\uff082.1.1 STABLE\u304c\u51fa\u3066\u3044\u305f\uff09<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>$ wget --no-check-certificate https:\/\/github.com\/cakephp\/cakephp\/zipball\/2.1.1\r\n09:37:11 (135.00 KB\/s) - `2.1.1' \u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f [1765102\/1765102]\r\n$ mv 2.1.1 cakephp-2.1.1.zip<\/pre><\/div><\/div>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u5c55\u958b<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>$ unzip cakephp-2.1.1.zip\r\nArchive:  cakephp-2.1.1.zip\r\n43cf2f06471ba9dcd5968b37ca68fcf3b343dd2c\r\n   creating: cakephp-cakephp-0cad237\/\r\n  inflating: cakephp-cakephp-0cad237\/.gitignore\r\n  inflating: cakephp-cakephp-0cad237\/.htaccess\r\n  inflating: cakephp-cakephp-0cad237\/.travis.yml\r\n  inflating: cakephp-cakephp-0cad237\/README\r\n   ...<\/pre><\/div><\/div>\n<p>\u5c55\u958b\u5f8c\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u79fb\u52d5\u3002\u30d5\u30a1\u30a4\u30eb\u306f\u300c~\/public_html\/cakephp-test\/\u300d\u306b\u7f6e\u304f\u3082\u306e\u3068\u3059\u308b\u3002<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>mv cakephp-cakephp-0cad237 ~\/public_html\/cakephp-test<\/pre><\/div><\/div>\n<p>\u3067\u3001\u30e6\u30fc\u30b6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067CakePHP\u3092\u8a66\u3057\u305f\u3044\u304c\u3001\u305d\u306e\u307e\u307e\u3060\u3068CakePHP\u304c\u4f7f\u3063\u3066\u3044\u308bApache\u306erewrite\u30eb\u30fc\u30eb\u304c\u4e0d\u5341\u5206\u3068\u306a\u3063\u3066\u30da\u30fc\u30b8\u3092\u8868\u793a\u3067\u304d\u306a\u3044\u3002<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>Not Found\r\nThe requested URL \/home\/oshiro\/public_html\/cakephp-test\/app\/webroot\/ was not found on this server.<\/pre><\/div><\/div>\n<p>\u3053\u308c\u306fRewriteRule\u306e<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>RewriteRule    ^$ app\/webroot\/    [L]<\/pre><\/div><\/div>\n<p>\u3067\u3001\u300capp\/webroot\/\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082\u5b9f\u969b\u306b\u306f\u300capp\/webroot\/app\/webroot\/\/\u300d\u3042\u305f\u308a\u3092\u8868\u793a\u3057\u3088\u3046\u3068\u3057\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3089\u3057\u3044\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001.htaccess\u306b\u4ee5\u4e0b\u306eRewriteBase\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\uff08\u305d\u308c\u4ee5\u524d\u306bApache\u5074\u3067\u30e6\u30fc\u30b6\u306e.htaccess\u3067\u306e\u8a2d\u5b9a\u3092\u6709\u52b9\u5316\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\uff09\u3002<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre># .\/.htaccess\r\n&lt;IfModule mod_rewrite.c&gt;\r\n   RewriteEngine on\r\n   RewriteBase    \/~oshiro\/cakephp-test\r\n   RewriteRule    ^$ app\/webroot\/    [L]\r\n   RewriteRule    (.*) app\/webroot\/$1 [L]\r\n&lt;\/IfModule&gt;<\/pre><\/div><\/div>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre># .\/app\/.htaccess\r\n&lt;IfModule mod_rewrite.c&gt;\r\n    RewriteEngine on\r\n    RewriteBase    \/~oshiro\/cakephp-test\/app\r\n    RewriteRule    ^$    webroot\/    [L]\r\n    RewriteRule    (.*) webroot\/$1    [L]\r\n&lt;\/IfModule&gt;<\/pre><\/div><\/div>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre># .\/app\/webroot\/.htaccess\r\n&lt;IfModule mod_rewrite.c&gt;\r\n    RewriteEngine On\r\n    RewriteBase    \/~oshiro\/cakephp-test\/app\/webroot\r\n    RewriteCond %{REQUEST_FILENAME} !-d\r\n    RewriteCond %{REQUEST_FILENAME} !-f\r\n    RewriteRule ^(.*)$ index.php [QSA,L]\r\n&lt;\/IfModule&gt;<\/pre><\/div><\/div>\n<p>\u3053\u308c\u3067CakePHP\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306f\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u304c\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30aa\u30fc\u30ca\u3092\u4e00\u822c\u30e6\u30fc\u30b6\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30da\u30fc\u30b8\u8868\u793a\u5074\u306eApache\u306e\u6a29\u9650\u304c\u4e0d\u8db3\u3067\u300c\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u4fdd\u5b58\u3067\u304d\u306a\u3044\u300d\u3068\u8b66\u544a\u304c\u51fa\u308b\uff1a<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>Warning (512): \/home\/oshiro\/public_html\/cakephp-test\/app\/tmp\/cache\/ is not writable [CORE\/Cake\/Cache\/Engine\/FileEngine.php, line 320]<\/pre><\/div><\/div>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u8a72\u5f53\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u3092\u4ed8\u52a0\u3002<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>$ chmod -R o+w app\/tmp\/cache\/<\/pre><\/div><\/div>\n<p>\u6b21\u306b\u3001Security.salt\u3084\u3089Security.cipherSeed\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u308b\uff1a<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>Notice (1024): Please change the value of 'Security.salt' in app\/Config\/core.php to a salt value specific to your application [CORE\/Cake\/Utility\/Debugger.php, line 806]\r\nNotice (1024): Please change the value of 'Security.cipherSeed' in app\/Config\/core.php to a numeric (digits only) seed value specific to your application [CORE\/Cake\/Utility\/Debugger.php, line 810]<\/pre><\/div><\/div>\n<p>\u306e\u3067\u3053\u308c\u3092\u8a2d\u5b9a\uff08\u4ee5\u4e0b\u306f\u5358\u306a\u308b\u4f8b\uff09\u3002<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>Configure::write('Security.salt', 'oshiro');\r\nConfigure::write('Security.cipherSeed', '4457');<\/pre><\/div><\/div>\n<p>\u3042\u3068\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u304c\u306a\u3044\u3068\u8a00\u3063\u3066\u304f\u308b\uff1a<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>Your database configuration file is NOT present.\r\nRename APP\/Config\/database.php.default to APP\/Config\/database.php<\/pre><\/div><\/div>\n<p>\u306e\u3067\u3001\u6307\u793a\u306b\u5f93\u3063\u3066database.php.default\u3092database.php\u3078\u30b3\u30d4\u30fc\uff1a<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>$ cp app\/Config\/database.php.default app\/Config\/database.php<\/pre><\/div><\/div>\n<p>\u3057\u3066\u3053\u308c\u3092\u81ea\u524d\u306e\u8a2d\u5b9a\u306b\u5408\u308f\u305b\u3066\u66f8\u304d\u63db\u3048\u3066\u3044\u304f\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u3001\u6a19\u6e96\u3067\u306fMySQL\u3092\u4f7f\u3046\u3088\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u3053\u308c\u306f\u300clib\/Cake\/Model\/Datasource\/Database\/Mysql.php\u300d\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u3002\u4eca\u56de\u306fSQLite\u3092\u4f7f\u3044\u305f\u3044\uff08\u8aad\u307f\u8fbc\u307e\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u300clib\/Cake\/Model\/Datasource\/Database\/Sqlite.php\u300d\u3067\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f33\uff09\u306e\u3067\u305d\u308c\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3059\u308b\u3002<\/p>\n<p>\u5143\u304c\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3082\u306e\uff1a<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>class DATABASE_CONFIG {\r\n        public $default = array(\r\n                'datasource' =&gt; 'Database\/Mysql',\r\n                'persistent' =&gt; false,\r\n                'host' =&gt; 'localhost',\r\n                'login' =&gt; 'user',\r\n                'password' =&gt; 'password',\r\n                'database' =&gt; 'database_name',\r\n                'prefix' =&gt; '',\r\n                \/\/'encoding' =&gt; 'utf8',\r\n        );\r\n        \/\/ ...\r\n}<\/pre><\/div><\/div>\n<p>\u3092\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30db\u30b9\u30c8\/\u30ed\u30b0\u30a4\u30f3ID\/\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u7a7a\u306b\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u306fSQLite\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u6307\u5b9a\u306f\u30b5\u30fc\u30d0\u4e0a\u306e\u30d5\u30eb\u30d1\u30b9\u3067\u306a\u3044\u3068\u30a2\u30af\u30bb\u30b9\u306b\u5931\u6557\u3059\u308b\u306e\u3067\u6ce8\u610f\uff09\u3068\u5909\u66f4\u3059\u308b\uff1a<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>class DATABASE_CONFIG {\r\n        public $default = array(\r\n                'datasource' =&gt; 'Database\/Sqlite',\r\n                'persistent' =&gt; false,\r\n                'host' =&gt; '',\r\n                'login' =&gt; '',\r\n                'password' =&gt; '',\r\n                'database' =&gt; '\/home\/oshiro\/public_html\/cakephp-test\/db\/database.sqlite3',\r\n                'prefix' =&gt; '',\r\n                \/\/'encoding' =&gt; 'utf8',\r\n        );\r\n        \/\/ ...\r\n}<\/pre><\/div><\/div>\n<p>\u3053\u3053\u3067\u306f\u3001\u300ccakephp-test\/\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306b\u300cdb\/\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u3001\u305d\u3053\u306bSQLite\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<div class=\"hl-surround\" style=\"height:16.8px;\"><div class=\"hl-main\"><pre>$ mkdir db\/<\/pre><\/div><\/div>\n<p>\u3067\u3001\u3068\u308a\u3042\u3048\u305aSQLite\u7528\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u7a7a\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u304a\u304d\u3001\u4ed6\u30e6\u30fc\u30b6\u3067\u3082\u5909\u66f4\u53ef\u80fd\u306e\u3088\u3046\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u5b9a\u3002<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre>touch db\/database.sqlite3\r\nchmod og+w db\/ db\/database.sqlite3<\/pre><\/div><\/div>\n<p>\u3055\u3089\u306b\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306a\u89b3\u70b9\u304b\u3089\u306f\u672c\u6765\u306fWeb\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u5834\u6240\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3079\u304d\u3060\u304c\u3001\u3053\u3053\u3067\u306f\u3068\u308a\u3042\u3048\u305a\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u95b2\u89a7\u3067\u304d\u306a\u3044\u3088\u3046db\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b.htaccess\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u3044\u3066\u95b2\u89a7\u7981\u6b62\u306b\u8a2d\u5b9a\uff1a<\/p>\n<div class=\"hl-surround\" ><div class=\"hl-main\"><pre># db\/.htaccess\r\norder deny,allow\r\ndeny from all<\/pre><\/div><\/div>\n<p>\u4ee5\u4e0a\u3067\u3001CakePHP\u81ea\u4f53\u306f\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CakePHP\u7df4\u7fd2(1)\u306e\u7d9a\u304d \u300cCakePHP\u306e\u30d6\u30ed\u30b0\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u300d\u3092\u52d5\u4f5c\u3055\u305b\u308b\u4f8b\u3002\u3053\u3053\u3067\u306f\u3001CakePHP\u306e\u52d5\u4f5c\u8a2d\u5b9a\u307e\u3067\u3002 \u307e\u305a\u3001CakePHP\u3092\u5165\u624b\uff082.1.1 STABLE\u304c\u51fa\u3066\u3044\u305f\uff09 $ wget &#8211;no- [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[285,123],"_links":{"self":[{"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/posts\/2300"}],"collection":[{"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":31,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":67468,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/posts\/2300\/revisions\/67468"}],"wp:attachment":[{"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/categories?post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mechsys.tec.u-ryukyu.ac.jp\/~oshiro\/SiteList\/wp-json\/wp\/v2\/tags?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}