Here is my example nginx
file, which I can get to work fine.
server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
root /var/www/test/public;
index index.php index.html index.htm;
server_name [the-ip-address];
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
If I put an index.php
file in /var/www/test/public/index.php
it displays on the page fine. But if I delete the folder /var/www/test
and do a fresh install of Laravel as /var/www/test
which includes a public/index.php
all I get is error 500.
This should work, and I believe it has something to do with Debian and permissions. I've tried running sudo chmod 755 -R /var/www/test
and chmod -R o+w /var/www/test/storage
which did help before, but I must be missing something this time.
Any idea why my setup works, but not with Laravel?