By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

open_basedir errors

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
*** 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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.