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 ./*

  • 相关阅读:
    java web项目防止多用户重复登录解决方案
    java提高篇(二一)-----ArrayList
    转:为什么需要htons(), ntohl(), ntohs(),htons() 函数
    转:对于linux下system()函数的深度理解(整理)
    转:sprintf与snprintf
    转: fscanf()函数详解
    转:fopen()函数
    转:struct sockaddr与struct sockaddr_in ,struct sockaddr_un的区别和联系
    转:BZERO()等的区别
    转:Linux内存管理之mmap详解
  • 原文地址:https://www.cnblogs.com/ailingfei/p/9279135.html
Copyright © 2011-2022 走看看