473,409 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

open_basedir errors

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:
Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening 'c:\web\httpdocs\session.php' for
inclusion (include_path='.;c:\php4\pear') in Unknown on line 0
This code has no includes infact the file is only this

<?php
phpinfo();
?>

How can i make this work.

Help is greatly appreciated
I should mention this is on a local testing machine WinXP and im using
PHP 4.3.7 and the httpdocs directory is the document root.
Jul 17 '05 #1
7 20768
*** Paul wrote/escribió (Tue, 24 Aug 2004 09:09:20 GMT):
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


You've probably set the open_basedir directive somewhere. That restricts
PHP access to certain directories. Check php.ini and your Apache config
files (http.conf, .htacces, etc).
--
-- Álvaro G. Vicario - Burgos, Spain
-- Questions sent to my mailbox will be billed ;-)
--
Jul 17 '05 #2

Thanks for replying.

Sorry to be sounding rude but i believe i mentioned i was using
open_basedir On in the php.ini

"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"

I probably should say how do i make sure that i dont get these errors
with it On. I dont see it with it off. Is there anything else the
open_basedir looks for.

Alvaro G Vicario wrote:
*** Paul wrote/escribió (Tue, 24 Aug 2004 09:09:20 GMT):
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

You've probably set the open_basedir directive somewhere. That restricts
PHP access to certain directories. Check php.ini and your Apache config
files (http.conf, .htacces, etc).


Regards
Paul
Jul 17 '05 #3
Paul <p_*********@iprimus.com.au> schrieb:
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:
Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening 'c:\web\httpdocs\session.php' for
inclusion (include_path='.;c:\php4\pear') in Unknown on line 0


Is the original code like that:

include("/session.php");

? Then try to make the path absolute:

include($_SERVER['DOCUMENT_ROOT']."/session.php");

HTH
Markus
Jul 17 '05 #4
Markus Ernst wrote:
Paul <p_*********@iprimus.com.au> schrieb:
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:
Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening 'c:\web\httpdocs\session.php' for
inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

Is the original code like that:

include("/session.php");

? Then try to make the path absolute:

include($_SERVER['DOCUMENT_ROOT']."/session.php");

HTH
Markus


Actually the file (session.php) is just

<?php
phpinfo();
?>

Which is why im so stumped.
Jul 17 '05 #5
Paul <p_*********@iprimus.com.au> schrieb:
Markus Ernst wrote:
Paul <p_*********@iprimus.com.au> schrieb:
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: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening 'c:\web\httpdocs\session.php' for
inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

Is the original code like that:

include("/session.php");

? Then try to make the path absolute:

include($_SERVER['DOCUMENT_ROOT']."/session.php");

HTH
Markus


Actually the file (session.php) is just

<?php
phpinfo();


Which is why im so stumped.


So session.php is not included from an other script, but called directly
from the browser's address line? Really strange. Sorry I am not familiar
with php.ini stuff; I just solved open_basedir restriction errors with
includes that way.

BTW I assume the missing question mark in your PHP end tag is a typo in your
posting, not in your file?

--
Markus
Jul 17 '05 #6

"Paul" <p_*********@iprimus.com.au> wrote in message
news:4B****************@news-server.bigpond.net.au...

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


I'm not near a php machine at the moment, but I seem to remember that the
"(1)" in your error message normally shows the paths allowed by
open_basedir. Did you "turn on" open_basedir by setting it to the value of
1? The value is supposed to be set to the list of directories (actually,
prefixes) to which the user is allowed access.

- Virgil
Jul 17 '05 #7
Virgil Green wrote:
"Paul" <p_*********@iprimus.com.au> wrote in message
news:4B****************@news-server.bigpond.net.au...
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

I'm not near a php machine at the moment, but I seem to remember that the
"(1)" in your error message normally shows the paths allowed by
open_basedir. Did you "turn on" open_basedir by setting it to the value of
1? The value is supposed to be set to the list of directories (actually,
prefixes) to which the user is allowed access.

- Virgil


Thanks that did it i was doing the configuration wrong. Once again
thanks very much

Paul
Jul 17 '05 #8

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

Similar topics

1
by: Felix Natter | last post by:
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...
3
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:...
0
by: Chris Ritson | last post by:
I am setting open_basedir to include only the DocumentRoot and PHP installation tree in 16 out of 18 VirtualHosts on our (test) apache server. This is running apache 2.0.53 and PHP 5.0.3. If I...
2
by: Brandons of mass destruction | last post by:
I'm trying to turn off open_basedir, and according to php.info, I've managed to do that in the master value column, by editing the php.ini file. But it's still on as local value for several...
2
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,...
0
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...
0
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...
6
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.