Warning: include() [function.include]: open_basedir restriction in effect. Fi...

softadmin 2017-4-7 1565

Warning: include() [function.include]: open_basedir restriction in effect. File() is not within the allowed path(s)
服务器环境:
系统:redhat
A网站:tp5+nginx+mysql+php5.6
B/C网站:dede
D网站:discuz

无论如何设置open_basedir,discuz论坛基本正常(不是这个论坛站点)。如果不设置open_basedir,dede站是正常的。如果在vhost中设置open_basedir,则当访问一次A站点之后,B、C站都会出错了,说找不到php文件。如果在php.ini
中设置,则B、C站无法访问。

最终解决方法:
sudo vim /usr/local/php/etc/php.ini,最后面添加:
[HOST=www.xxxx.xxxx]
open_basedir = "/home/wwwroot/www.xxxx.xxxx/:/tmp/:/proc/"

如此一来,则只对A站点设置了open_basedir,问题解决。最后,sudo service php-fpm restart 重启php服务。





最新回复 (0)
返回