【php】Laravelで/vendor以下のディレクトリが見つからない時
mokabuu
mokabuu.com
Laravel x Nginxでサービスを作っていた子羊ちゃんが、
ランティングページのpathを変えた瞬間にphpファイルが読み込まれなくなったと言って僕の元に迷い込んできました。
確かに、nginxでphpを読み込むのってちょっと癖があった気がします。
なので今日はconfファイルのサンプルを載っけておきたいと思います。
location /lp01 { alias /var/www/html/1; try_files $uri $uri/ /index.php?$args; index index.php; location ~ \.(php)$ { fastcgi_split_path_info ^(.+?\.php)(/.*)?$; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } }
phpは入れ子にして書いてあげましょう!
[adsense]