Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/svnrepos/thinkphp/base.php

时间:2024-05-23 20:09:51

Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/svnrepos/thinkphp/base.php) is not within the allowed path(s): (/www/wwwroot/svnrepos/public/:/tmp/:/proc/) in /www/wwwroot/svnrepos/public/index.php on line 16

Warning: require(/www/wwwroot/svnrepos/thinkphp/base.php): failed to open stream: Operation not permitted in /www/wwwroot/svnrepos/public/index.php on line 16

Fatal error: require(): Failed opening required ‘/www/wwwroot/svnrepos/public/…/thinkphp/base.php’ (include_path=’.:/www/server/php/72/lib/php’) in /www/wwwroot/svnrepos/public/index.php on line 16

宝塔面板中ThinkPHP5更改网站目录为/public后运行报错
百度一圈 找到了解决办法,记录一下,省得忘
Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/svnrepos/thinkphp/base.php
原因如下:open_basedir 将PHP所能打开的文件限制在指定的目录树中,包括文件本身。当程序要使用例如fopen()或file_get_contents()打开一个文件时,这个文件的位置将会被检查。当文件在指定的目录树之外,程序将拒绝打开。

本指令不受安全模式打开或关闭的影响。
办法来源 http://www.02405.com/program/php/1820.html