zoukankan      html  css  js  c++  java
  • nginx no input file specified 终极解决办法

    网上的方法大部分都靠谱

    出现这个原因 是因为路径不对,没有解析对应路径下的php文件

    只要你的配置都正常一般不会出现这个问题

    下面是我的nginx配置文件,以edusoho配置举例

    server {
        listen 80;
    
        # [改] 网站的域名
        server_name ke.zh******u.com;
    
        #301跳转可以在nginx中配置
    
        # 程序的安装路径
        root /mnt/wwwroot/edusoho/web;
    
        # 日志路径
        access_log /mnt/log/nginx/access_edusoho.log;
        error_log /mnt/log/nginx/error_edusoho.log;
    
        location / {
            index app.php;
            try_files $uri @rewriteapp;
        }
    
        location @rewriteapp {
            rewrite ^(.*)$ /app.php?/$1 last;
        }
    
        location ~ ^/udisk {
            internal;
            root /mnt/wwwroot/edusoho/app/data/;
        }
    
        location ~ ^/(app|app_dev).php(/|$) {
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_split_path_info ^(.+.php)(/.*).php$;
            include fastcgi_params;
            fastcgi_param PHP_ADMIN_VALUE "open_basedir=/mnt/wwwroot/edusoho:/tmp/:/proc/";
            fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            fastcgi_param  HTTPS              off;
            fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
            fastcgi_param HTTP_X-Accel-Mapping /udisk=/mnt/wwwroot/edusoho/app/data/udisk;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 8 128k;
        }
    
        # 配置设置图片格式文件
        location ~* .(jpg|jpeg|gif|png|ico|swf)$ {
            # 过期时间为3年
            expires 3y;
    
            # 关闭日志记录
            access_log off;
    
            # 关闭gzip压缩,减少CPU消耗,因为图片的压缩率不高。
            gzip off;
        }
    
        # 配置css/js文件
        location ~* .(css|js)$ {
            access_log off;
            expires 3y;
        }
    
        # 禁止用户上传目录下所有.php文件的访问,提高安全性
        location ~ ^/files/.*.(php|php5)$ {
            deny all;
        }
    
        # 以下配置允许运行.php的程序,方便于其他第三方系统的集成。
        location ~ .php$ {
            # [改] 请根据实际php-fpm运行的方式修改
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_split_path_info ^(.+.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            fastcgi_param  HTTPS              off;
        }
    }

    这个配置文件是没问题的,但是访问的时候频繁出现 no input file specified 

    后来改了用户权限就好了

    把项目目录改为:

    chown -R www:www ./*

  • 相关阅读:
    SVN 怎么让文件脱离 版本控制
    WEB开发中使用和理解 .net中的认证与授权
    三层,师姐把我点透了
    三层与养猪,加入自己的理解。
    Asp.net的登录验证方法Web.config访问权限配置
    <%=%> 引发的aspx文件、.aspx.cs文件和.aspx.designer.cs的一些说明
    bin。obj Properties文件夹
    JS得到对应字段 的值。遍历
    C#中页面传值的方法。转载
    $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • 原文地址:https://www.cnblogs.com/ailingfei/p/9279135.html
Copyright © 2011-2022 走看看