【发布时间】:2016-01-31 08:19:50
【问题描述】:
我不断收到403 Forbidden
我的设置:
/etc/nginx/sites-available/default
默认
server {
listen 80;
root home/laravel-app/;
index index.php index.html index.htm;
server_name example.com;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
更新
我遵循了这条指令:here
对此的任何提示/建议将是一个巨大的帮助!
【问题讨论】:
-
你安装了php5-fpm吗?
-
能不能翻一下nginx的错误日志,看看收到Status 500的时候是什么错误?我有一种预感,您的
sock文件可能有错误的权限,导致该状态为 500。要么是这样,要么是你的 PHP 配置中的某些东西。 -
嗯,你可以尝试做
chmod 666 (or 777) /var/run/php6-fpm.sock,重启nginx再试一次。如果可行,您可能需要进入/etc/php5/fpm/php-fpm.conf并检查user和group以及listen.owner和listen.group。您可能需要将运行nginx的用户添加到运行同一groupphp 的用户,这样您就不会遇到问题。通常 phpsock具有权限0660。 -
你试过了吗:
chown -R www-data:www-data /home/benu/home/forge/ssc-portal。还是chmod +x /home/benu/home/forge/ssc-portal/index.php? -
我已经准备好了。我的网站正在加载。这个answer 对我有用。
标签: php laravel nginx ubuntu-12.04 laravel-5.1