473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open_basedir restriction

hi,

I read the section about open_basedir in the safe_mode
documentation (http://de3.php.net/features.safe-mode)
but this only confirmed my understanding of open_basedir
and didn't help understand the problem below. I tried
to search the net, but couldn't find anything yet.

here is my test-case
(with php_admin_value open_basedir /home/m2004001):

/home/m2004001/Test/test1.php:
<?php
echo "test1";
include("tmp/test2.php");
?>
/home/m2004001/Test/tmp/test2.php:
<?php
echo "test2";
include("test3. php");
?>
/home/m2004001/Test/tmp/test3.php:
<?php
echo "test3";
?>

now load test1.php in the browser and you get:
Warning: open_basedir restriction in effect. File is in wrong
directory in /home/m2004001/Test/tmp/test2.php on line 3

In my project I have all my include files in app/include, and when I
include another include-file in an include-file I omit the path (as in
the example above).

It works when I use absolute paths in include, but I don't want to
specify a path involving the DocumentRoot (in case it gets moved),
and a path like "include('/app/include/test.php')" doesn't work.

thanks,

--
Felix Natter
Jul 17 '05 #1
1 2087

this is probably bug #22101. Is there workaround (besides absolute
filesystem paths)?

--
Felix Natter
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
20782
by: Paul | last post by:
Hi Im testing a script to see if it works in different situations and open_basedir is one of them. However if i turn it On all i get is errors Warning: Unknown(): open_basedir restriction in effect. File(c:\web\httpdocs\session.php) is not within the allowed path(s): (1) in Unknown on line 0 Warning: Unknown(c:\web\httpdocs\session.php): failed to open stream:
3
4627
by: Alvaro G Vicario | last post by:
This is the open_basedir restriction of my site: php_admin_value open_basedir /tmp/:/home/site/ All my PHP files are under /home/site/htdocs. However, I get lots of errors like: Warning: open_basedir restriction in effect. File is in wrong directory in /home/site/.......
2
2631
by: Brandons of mass destruction | last post by:
I recently reconfigured open_basedir so that it wasn't quite so limited. Now, I'm getting erros with php script that use to run fine, and I can't figure out what went wrong. Previously, open_basedir was configured (locally) like so: /home/httpd/vhosts/mydomain.com/httpdocs/:tmp/ I changed it to /home/httpd/vhosts/
0
2344
by: jeff.battle | last post by:
I'm trying to get PEAR DB to work on my machine at serverbeach but I'm getting the following error: Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/DB.php) is not within the allowed path(s): (/home/httpd/vhosts/adapttosolve.com/httpdocs:/tmp) in... phpinfo() says I have the following open_basedir values set: open_basedir | /home/httpd/vhosts/adapttosolve.com/httpdocs:/tmp | no value
0
2478
by: erwinschrijver | last post by:
On a previous installed server my site which uses several PEAR-packages worked fine. Now it's transfered to a new server. (Both servers installed with Windows 2003 / IIS 6, on the previous server the PHP version was 5.03, on the new one 5.05) The site gives a open_basedir restriction on this new server. In the php.ini the open_basedir line is commented, but when I run the command phpinfo() there appears to be a local value, which I...
2
3000
by: sreniaw | last post by:
Hello, I use php 5.1.4 with apache 2.2.2 on Solaris 10. The problem is that I can't configure open_basedir because I always get warming message: Warning: readfile() : open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/wwwroot/default) in /wwwroot/default/mk.php on line 3 Warning: readfile(test.txt) : failed to open stream: Not owner in /wwwroot/default/mk.php on line 3
6
15043
by: lawrence k | last post by:
If I ssh to my server and look at the php.ini file, it apears that open_basedir is off: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per- directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ;open_basedir =
1
4646
by: Markus | last post by:
Hi My ISP seems to have made a PHP version upgrade - without any change in the code, a new error occurs: PHP Warning: ftp_nlist() : open_basedir restriction in effect. File(/var/tmp/) is not within the allowed path(s): (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/) in ... I have found some bugs related to open_basedir and temp directory
2
839
by: rdlowrey | last post by:
Okay, I've tried a bunch of things on this one and can't figure it out. The line in my phpinfo: open_basedir /var/www/vhosts/mysite.com/subdomains/intranet/httpdocs:/ tmp no value Why would I get a "Warning: move_uploaded_file(): open_basedir restriction in effect." error message if I've used SSH to set the Master open_basedir value to "no value" (as evidenced by phpinfo)?
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.