这是我的示例nginx
文件,我可以正常工作。
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;
}
}
如果我在index.php
中放入/var/www/test/public/index.php
文件,则会在页面上显示正常。但是,如果我删除文件夹/var/www/test
并执行全新安装的Laravel /var/www/test
,其中包含public/index.php
,我得到的就是错误500.
这应该有用,我相信它与Debian和权限有关。我之前尝试过运行sudo chmod 755 -R /var/www/test
和chmod -R o+w /var/www/test/storage
但之前有所帮助,但这次我一定错过了。
知道为什么我的设置有效,但不适用于Laravel?