vagrant + シェルスクリプトでLaravelのセットアップまでを自動構築したいと設定ファイルを書いてるのですが詰んでます。
なんとかLaravelを動かすところまでいったのですが、ルートにアクセスすると以下のエラーが出てしまいます。
Class 'App\Providers\ApplicationServiceProvider' not found
![ルートにアクセス]WIDTH:600
ホストOS側の階層はこんな感じです。
作業用ディレクトリ ├ プロジェクト本体のディレクトリ(Laravel) └ vagrantファイルがあるディレクトリ ├Vagrantfile └セットアップ用シェルスクリプト
Vagrantfileの共有ディレクトリ設定
config.vm.synced_folder "../プロジェクト本体", "/var/www", owner: "vagrant", group: "nginx", :mount_options => ['dmode=777','fmode=777']
nginxの設定(全体)
server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { root /var/www/public; index index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/public; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ .php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root /var/www/public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/public$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /.ht { # deny all; #} }
php-fpmの設定(変更部分のみ抜粋 user/groupをapache→nginxに変更)
; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: nginx Choosed to be able to access some dir as httpd user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginx
パーミッションの設定がおかしいのか、他に原因があるのかさっぱりです。
また以下のように作成済みのAPIに対してアクセスするとLaravelのルーティングエラーではなく、nginxの404エラーが返ってくるのですがこれも設定が悪いのでしょうか?
192.168.33.10/api/hoge?id=1
どなたかお知恵を貸し下さい。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2014/09/09 08:50
2014/09/09 09:15
2014/09/09 09:47