环境:
宝塔某版本搭建的php5.6和nginx1.*
本想导入一个sql文件,然后打开phpmyadmin,结果显示No input file specified
网上说删除.user.ini,没用
如下配置nginx.conf或者对应网站的conf文件,也没用:
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
#这里需要注意一下的是,只安装了一个版本的php,没有用上9000这个端口,netstat -an|grep 9000没有显示
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/server/phpmyadmin/$fastcgi_script_name;
include fastcgi_params;
}
也没见到有fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/;
服务器上两个网站,一个能正常访问,另一个显示404 not found
一顿猛操作没能解决,错误日志显示:
2020/02/16 21:40:15 [error] 18286#0: *272 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/www/wwwroot/aaa.cn/index.php) is not within the allowed path(s): (/www/wwwroot/bbb.cn/:/tmp/:/proc/) in Unknown on line 0
PHP message: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Unable to open primary script: /www/wwwroot/aaa.cn/index.php (Operation not permitted)" while reading response header from upstream, client: 181.*.*.*, server: www.chinahui.cn, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-56.sock:", host: "www.chinahui.cn"
最后排查到php.ini里面配置了open_basedir =/www/wwwroot/bbb.cn/:/tmp/:/proc/
将其注释掉aaa.cn恢复正常,phpmyadmin也能访问了