require(): open_basedir restriction in effect 错误 和 open_base_dir 且没有包含 ,您将无法上传文件。

服务器环境:linux 、php5.39nts 、nginx

框架:ecshop

  今日在做业务调整时,用到了数组,定义是数组时这样写的: 定义一个空数组,$area_info = [] ; 传到服务器后,提示

Parse error: syntax error,unexpected '[' in D:\www\user.php on line 6817

  再三查看代码段,确认没有问题,后查询数组方式 [] 这种定义方式为自 PHP 5.4 起(参考:http://php.net/manual/zh/language.types.array.php);

不支持就换写法吧,后改成:$arr = array(); 再次报错;

Warning: require() [function.require]: open_basedir restriction in effect. File(D:\includes\init.php) is not within the allowed path(s): (/www/wwwroot/:/tmp/:/proc/) in D:\index.php on line 18

Warning: require(D:\includes\init.php) [function.require]: failed to open stream: Operation not permitted in D:\index.php on line 18

Fatal error: require() [function.require]: Failed opening required 'D:\includes\init.php' (include_path='.;C:\php\pear') in D:\index.php on line 18

 

后修改php.ini文件的 ;open_basedir =  将前面的分号去掉

;open_basedir = 

  windows 修改为:

open_basedir = "D:/WWW; C:/Users/lenovo/AppData/Local/Temp"

  linux 修改为:

open_basedir = "D:/WWW;"

  OK !问题解决完毕!

posted @ 2018-06-11 15:26  梦缘&江南~  阅读(272)  评论(0)    收藏  举报