VPS侦探论坛

 找回密码
 注册
查看: 1562|回复: 1

No input file specified 两台同环境其中一台有问题

[复制链接]
发表于 2022-5-14 12:38:01 | 显示全部楼层 |阅读模式

2台 X86 CentOS 7.9 都是腾讯云,几乎无任何区别.


同样安装 LNMP 1.8 配置一摸一样

同样一个 vue + Laravel 项目,安装部署流程一摸一样,权限也都设置 www:www.

domain.conf 是自己写的,不是 lnmp vhost生成,没有 .user.ini


    location / {
        index  index.php index.html index.htm;
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass   unix:/tmp/php-cgi.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }




public 内的文件如下



fastcgi.conf
注释掉

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

并增加


fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";

才能正常访问,但是这样又影响了其他php程序

主要搞不懂的是另外一台服务器完全没任何问题. fastcgi.conf 也有这个
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";


现在懵了..不知道到底如何
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-5-14 18:49:44 | 显示全部楼层


No input file specified 就是因为防跨目录设置
设置成fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 都影响的

如果想保留防跨目录设置就只能去掉 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 的设置,保留使用.user.ini 但是如果你网站程序存在漏洞被上传webshell之类的话还是可能会被跨目录的

不清楚你具体其他程序目录结构,如果多个都在/home/wwwroot/ 下的话 fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/"; 是可以的,但是这样一样其他网站目录只要有一个被拿下其他也不会幸免。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 12:29 , Processed in 0.025866 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表