FuelPHP å°å ¥
ã»å°å ¥ç°å¢
CentOS 6.3 Apache 2.2.15 PHP 5.3.3 MySQL Server 5.1.67 FulePHP 1.5
ã»FuelPHPã®å°å ¥
# yum install curl git # curl get.fuelphp.com/oil | sh
ã»ããã¸ã§ã¯ãã®ä½æ
# cd /var/www/html # oil create project_name â»ãFatal error: Exception thrown without a stack frame in Unknown on line 0ãã¨è¡¨ç¤ºãããå ´å㯠ãä¸è¨ã®PHPã®ã¿ã¤ã ã¾ã¼ã³è¨å®ãè¦ç´ã # vi /etc/php.ini date.timezone = 'Asia/Tokyo'
ã»ãã¼ã¸ã§ã³ã®ç¢ºèª
# cd project_name # php oil -v
ã»ã¢ã¯ã»ã¹ç¢ºèª
http://<IPã¢ãã¬ã¹>/project_name/public/index.php/welcome â»publicãæ¶ãããå ´å㯠index.php ã®å 容ãç·¨éãã¦åç §å ãå¤æ´ãã
ã»index.php ãæ¶ã
# vi fuel/app/config/config.php index_file' => false, # vi public/.htaccess RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$ RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC] RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L] â»ã³ã¡ã³ããæ¶ã # vi /etc/httpd/conf/httpd.conf â»AllowOverride None ã§ç¡ããã¨ã確èªãã
ã»ç°å¢ã®ã»ãã
# vi fuel/app/bootstrap.php Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT);
ã»DBã®è¨å®
# vi fuel/app/config/development/db.php 'dsn' => 'mysql:host=localhost;dbname=fuel_dev', 'username' => 'root', 'password' => '',
ã»DBã®ä½æ
# mysql -u root -p mysql> CREATE DATABASE fuel_dev;
ã»scaffold
# cd project_name # oil generate scaffold post title:string summary:varchar[250] body:text # oil refine migrate
ã»ORMã®ãã¼ãè¨å®
# vi fuel/app/config/config.php 'always_load' => array( 'packages' => array( 'orm', ), ), â»ã³ã¡ã³ããæ¶ã
ã»ã¢ã¯ã»ã¹
http://<IPã¢ãã¬ã¹>/project_name/public/index.php/post/