带有Yii配置错误的NGINX
我在Ubuntu 13.04 x64服务器上工作,我成功安装了NGINX和PHP-FPM,并确保它们也能正常工作。然而,在修改配置文件以匹配Yii的配置之后,我得到了一个空白页面 这是我的NGINX配置文件:带有Yii配置错误的NGINX,yii,nginx,php,Yii,Nginx,Php,我在Ubuntu 13.04 x64服务器上工作,我成功安装了NGINX和PHP-FPM,并确保它们也能正常工作。然而,在修改配置文件以匹配Yii的配置之后,我得到了一个空白页面 这是我的NGINX配置文件: #config file server { listen 80; set $host_path "/usr/share/nginx/html/something"; server_name something.com; root /usr/sh
#config file
server {
listen 80;
set $host_path "/usr/share/nginx/html/something";
server_name something.com;
root /usr/share/nginx/html/something;
set $yii_bootstrap "index.php";
charset utf-8;
location / {
index index.html $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}
location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}
#avoid processing of calls to unexisting static files by yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
这是工作的原始配置文件:
server {
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name campusplugin.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/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
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/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我刚刚更改了根目录,因为我将文件保存在根目录中指定的相应目录中
然而,每当我试图访问该网站时,我都会得到一个空白页面,里面什么都没有。
我不知道我哪里出错了。我对NGINX很陌生
请帮助我。有时当您将Nginx与php一起使用时,fpm不会显示php错误,因此Nginx返回空页面 1) 如果要查看此“隐藏”错误,请尝试为nginx安装错误日志,添加以下服务器名称:
error_log /path/to/your/error-log/fpm-error.log;
谢谢你提供的信息。。这正是问题所在。相反,我在php.ini中启用了错误报告:)