• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Nginx 提示 no input file specified 。

php 搞代码 3年前 (2022-01-25) 59次浏览 已收录 0个评论
文章目录[隐藏]

因为磁盘位置不够了要做迁移,vhost的配置文件

<code>server {    listen       80;    server_name ***.****.com;    index index.php index.html index.htm;    root  /home/wwwroot/default;        error_page   404   /404.html;    error_page   502 504   /502.html;    include enable-php.conf;    location / {        index index.php index.html ;    }    location /nginx_status    {        stub_status on;        access_log   off;    }    location /status {        stub_status on;        access_log   off;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$    {      #  expires      30d;    }    location ~ .*\.(js|css)?$    {    #    expires      12h;    }    location ~ \.php$ {            #root html;            fastcgi_pass 127.0.0.1:9000;            fastcgi_index index.php;            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;            #fastcgi_param SCRIPT_FILENAME /mnt/wwwroot/default$fastcgi_script_name;            include fastcgi_params;    }    access_log  /home/wwwlogs/access.log  access;}  </code>

其中root /home/wwwroot/default;改成root /mnt/wwwroot/default;提示no input file specified

/mnt/wwwroot/default这个目录肯定是存在的,因为其他的配置server是可以访问的

奇怪的是设置/home/wwwroot/default好使,设置为root /mnt/wwwroot/default;就报错,
这两个文件夹的内容是完全一致的。
求解。


原因

找到问题的原因了,目录下有个.user.ini文件,nginx跨目录用的,直接cp过来,这个文件没改内容还是open_basedir=/home/wwwroot/default:/tmp/:/proc/
改成open_basedir=/mnt/wwwroot/default:/tmp/:/proc/就好使了

回复内容:

……本2文来源gaodai.ma#com搞##代!^码@网3

搞代gaodaima码

因为磁盘位置不够了要做迁移,vhost的配置文件

<code>server {    listen       80;    server_name ***.****.com;    index index.php index.html index.htm;    root  /home/wwwroot/default;        error_page   404   /404.html;    error_page   502 504   /502.html;    include enable-php.conf;    location / {        index index.php index.html ;    }    location /nginx_status    {        stub_status on;        access_log   off;    }    location /status {        stub_status on;        access_log   off;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$    {      #  expires      30d;    }    location ~ .*\.(js|css)?$    {    #    expires      12h;    }    location ~ \.php$ {            #root html;            fastcgi_pass 127.0.0.1:9000;            fastcgi_index index.php;            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;            #fastcgi_param SCRIPT_FILENAME /mnt/wwwroot/default$fastcgi_script_name;            include fastcgi_params;    }    access_log  /home/wwwlogs/access.log  access;}  </code>

其中root /home/wwwroot/default;改成root /mnt/wwwroot/default;提示no input file specified

/mnt/wwwroot/default这个目录肯定是存在的,因为其他的配置server是可以访问的

奇怪的是设置/home/wwwroot/default好使,设置为root /mnt/wwwroot/default;就报错,
这两个文件夹的内容是完全一致的。
求解。


原因

找到问题的原因了,目录下有个.user.ini文件,nginx跨目录用的,直接cp过来,这个文件没改内容还是open_basedir=/home/wwwroot/default:/tmp/:/proc/
改成open_basedir=/mnt/wwwroot/default:/tmp/:/proc/就好使了

set $phproot /mnt/wwwroot/default;
fastcgi_param SCRIPT_FILENAME $phproot/$fastcgi_script_name;


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Nginx 提示 no input file specified 。

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址