Home > php教程 > php手册 > require,include和require_once,include_once 出现open_basedir错误

require,include和require_once,include_once 出现open_basedir错误

WBOY
Release: 2016-05-25 16:52:46
Original
1022 people have browsed it

只要使用require或include包含文件(不管是./xx.php还是xx.php)都是报下面的错误

Warning: include() [function.include]: open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/:/tmp/:/var/cache/) in /var/www/testdir.php on line 2

php 5.2.17听说 open_basedir 有所改动,查看发现原来php5.2.10中的php.ini是使用右斜杠:open_basedir = "e:/web/;C:/WINDOWS/TEMP/;"

升级到5.2.17 就tmd一直报错,改成左斜杠就好了,这叫什么事,难怪很多程序都会手工处理一下斜杠问题,估计就为了应对这一出:open_basedir = "e:web;C:WINDOWSTEMP;"

这样就解决了,如果不是php设置问题错误提示一般是 Warning: include() [function.include]: URL file-access is disabled in the server configuration

这个解决办法只要把包含路径调正常即可。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template