【发布时间】:2016-07-09 10:35:38
【问题描述】:
我已经尝试了很多配置设置让 nginx 与 laravel 一起使用,但没有一个可以。我的网页上不断收到 500 错误。
example.com 当前无法处理此请求。
server {
listen _:80;
server_name example.com;
root "C:\Users\Administrator\Google Drive\projects\laravel";
index index.php index.html;
log_not_found off;
charset utf-8;
access_log logs/cdn.example.com-access.log ;
location ~ /\. {deny all;}
location ~ \.css {
add_header Content-Type text/css;
}
location ~ \.js {
add_header Content-Type application/x-javascript;
}
location / {
include mime.types;
}
location = /favicon.ico {
}
location = /robots.txt {
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9054;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我对 laravel 非常陌生,对 nginx 也很陌生,我的所有 laravel 文件都在我刚刚从 http://localhost:8000 开发服务器移动的文档根目录中。我怎样才能让它活起来并让它与 nginx 一起工作?
【问题讨论】:
-
你确定它应该是 example.com 吗?
-
谷歌搜索“Laravel 500 错误代码”会导致这里出现。原因之一也是 PHP 版本。就我而言,我有一台运行 PHP 5.3 的旧服务器,我尝试在它上面安装 Laravel。
标签: php laravel nginx laravel-5