wordpress出现nginx File not found错误

一.问题:访问页面显示
wordpress中nginx File not found 错误

 

二.过程描述:
配置nginx
server {
    listen   80;
    server_name  10.0.0.8;
    index index.php;

    location / {
    root          /html/www/wordpress;
}
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

}

 

三.处理过程:
方法一:在匹配php页面规则里加上站点目录
server {
     listen 80;
     server_name 10.0.0.8;
     index index.php;

 location / {
     root /html/www/wordpress;
  }
 location ~ \.php$ {
     root /html/www/wordpress;
     fastcgi_pass 127.0.0.1:9000;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
   }

}

方法二:将$document_root替换成根目录/html/www/wordpress
server {
listen 80;
server_name 10.0.0.8;
index index.php;

location / {
root /html/www/wordpress;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /html/www/wordpress$fastcgi_script_name;
include fastcgi_params;
}

}

 

四.原因:
使用php-fpm解析PHP,出现”No input file specified”,”File not found”错误,原因是php-fpm进程找不到SCRIPT_FILENAME配置的要执行的.php文件,php-fpm返回给nginx的默认404错误提示
赞赏

微信赞赏支付宝赞赏

故障案例

tomcat设置开机自启动失败

2019-10-28 8:50:30

故障案例

Zabbix server is not running: the information displayed may not be current.

2019-11-6 8:55:53

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索