Nginx1.10 + Fuelphp1.8 を試してみる

前回からの続き

fuelphpをクローンする

$ cd /var/www
$ git clone git://github.com/fuel/fuel.git myapp

アプリ毎の設定ファイルを作成

server {
        listen 80;
        server_name 192.168.33.11; # example.com
        charset utf8;
        root /var/www/fuelphp/public; # fuelディレクトリと並びのpublicディレクトリ
        access_log /var/log/nginx/myapp_access.log;
        error_log /var/log/nginx/myapp_error.log;

        location / {
                index index.php;
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                include /etc/nginx/fastcgi_params;
                #fastcgi_pass 127.0.0.1:9000;
                fastcgi_pass unix:/var/run/php-fpm.sock; # php-fpmの場合
                fastcgi_index index.php;
                fastcgi_param FUEL_ENV "production";
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
}

ブラウザでアクセスしたらfuelphpがエラーを返した。

No composer autoloader found. Please run composer to install the FuelPHP framework dependencies first!

アプリのディレクトリでupdateをかける

$ cd myapp
$ php composer.phar update

上記コマンドを叩いて、当該URLにアクセスしてFuelPHPのトップ画面が見えていたらOK!

=> http://192.168.33.10/index.php/welcome
=> http://192.168.33.10/index.php/welcome/index/aaa/bbb/ccc

など、PATH_INFOが正しく動作しているか等のチェックを行う。

参考
http://qiita.com/1000VICKY/items/6331da7526f5998abea6
http://appstars.jp/archive/752
http://dev.classmethod.jp/server-side/framework/fuelphp003/
http://fuelphp.jp/docs/1.8/installation/instructions.html
ありがとうございます!