php warning require,Thinkphp 网站打开提示Warning: require(): open_basedir restriction in effect另一种解决方法...

博客内容讲述了在使用Thinkphp框架时遇到的open_basedir限制错误,导致无法正常打开网站。错误信息显示文件路径不在允许的路径范围内。解决方案是检查并修改宝塔面板中.user.ini文件的内容,将根目录设置为允许路径,从而解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Thinkphp网站打开报错如下:

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

Warning: require(/www/wwwroot/123.com/heikeji/simplewind/thinkphp/base.php): failed to open stream: Operation not permitted in /www/wwwroot/123.com/heikeji/public/index.php on line 40

Fatal error: require(): Failed opening required '/www/wwwroot/123.com/heikeji/public/../simplewind/thinkphp/base.php' (include_path='.:/www/server/php/54/lib/php') in /www/wwwroot/123.com/heikeji/public/index.php on line 40

解决方法:

如果朋友们使用的环境是宝塔

宝塔部署网站后会自动生成一个.user.ini的文件,修改下里面的内容更改为根目录即可解决~01903f2303fd0ac74e96dd767b78fe22.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值