Home > Backend Development > PHP Tutorial > require, include and require_once, include_once open_basedir error occurs_PHP tutorial

require, include and require_once, include_once open_basedir error occurs_PHP tutorial

WBOY
Release: 2016-07-13 10:56:29
Original
1134 people have browsed it

We have open_basedir errors in require, include and require_once, include_once. Baidu has some solutions below. Friends in need can refer to them.

As long as you use require or include to include a file (whether it is ./xx.php or xx.php), the following error will be reported
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

I heard that open_basedir has been changed in php 5.2.17. After checking, I found that the original php.ini in php5.2.10 uses a right slash

 代码如下 复制代码
open_basedir = "e:/web/;C:/WINDOWS/TEMP/;"

After upgrading to 5.2.17, tmd keeps reporting errors. Just change it to a left slash. What is this? No wonder many programs deal with the slash problem manually, probably just to deal with this problem

This solves the problem
The code is as follows
 代码如下 复制代码

open_basedir = "e:web;C:WINDOWSTEMP;"

Copy code

open_basedir = "e:web;C:WINDOWSTEMP;"

If it is not a php setting problem, the error message is usually Warning: include() [function.include]: URL file-access is disabled in the server configuration

The solution is to adjust the include path to normal. http://www.bkjia.com/PHPjc/632171.htmlwww.bkjia.comtrue
http: //www.bkjia.com/PHPjc/632171.html
TechArticle
We have open_basedir errors in require, include and require_once, include_once. Baidu has some solutions below. Friends in need Please refer to it. Just use require or i...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template