ThinkPHP报错:open_basedir restriction in effect. File() is not within the allowed path

作者: 坎肩儿 分类: ThinkPHP框架 发布时间: 2012-03-01 09:00

刚开始学习ThinkPHP,配置好后就报错:

Warning: require() [function.require]: open_basedir restriction in effect. File(../../ThinkPHP/ThinkPHP.php) is not within the allowed path(s): (D:/DedeAMPZ/WebRoot/Examples) in D:\DedeAMPZ\WebRoot\Examples\Hello\index.php on line 17

Warning: require(../../ThinkPHP/ThinkPHP.php) [function.require]: failed to open stream: Operation not permitted in D:\DedeAMPZ\WebRoot\Examples\Hello\index.php on line 17

Fatal error: require() [function.require]: Failed opening required ‘../../ThinkPHP/ThinkPHP.php’ (include_path=’.;C:\php5\pear’) in D:\DedeAMPZ\WebRoot\Examples\Hello\index.php on line 17

测试环境:DedeAMPZ PHP整合套件客户端

报错后百度一下,得到下面的解决方案,并成功解决。

1、打开目录:D:\DedeAMPZ\Program\Apache\conf 下面的:httpd-vhosts.conf

2、修改:php_admin_value open_basedir “D:/DedeAMPZ/WebRoot/Examples” 为:php_admin_value open_basedir “D:/DedeAMPZ/”

成功解决!