Open_basedir restriction in effect

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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:

I changed it to

Now I get the following errors:

Warning: open_basedir restriction in effect. File is in wrong directory
in /home/httpd/vhosts/ on
line 192

Warning: fopen("fileupload/Aleph One Log.txt", "r") - No such file or
directory in
/home/httpd/vhosts/ on line

Warning: stat failed for fileupload/Aleph One Log.txt (errno=2 - No such
file or directory) in
/home/httpd/vhosts/ on line

Warning: fread(): supplied argument is not a valid File-Handle resource
in /home/httpd/vhosts/ on
line 195

These are the lines of code:

192                     copy ($_FILES['quarkfile']['tmp_name'],

193                     $open=
fopen("fileupload/".$_FILES['quarkfile']['name'], r);

194                     $filesize =

195                      $wholefile = fread( $open, $filesize );

anyone know what i've done wrong?

Re: Open_basedir restriction in effect

*** Brandons of mass destruction escribiˇ/wrote (Sat, 12 Mar 2005 22:23:44
Quoted text here. Click to load it

Assuming your paths are correct and you are accessing files within the
allowed tree, I can tell you I've often found this error when using
relative paths in the include constructs. Perhaps PHP searches for the file
in the include_path list of directories, which may be outside the tree
(anyway, I didn't have time for proper testing so I can't tell you if this
is actually the reason). There are probably better solutions but using full
paths definitively solves the problem. The variable
$_SERVER['DOCUMENT_ROOT'] can be helpful.

-+ ┴lvaro G. Vicario - Burgos, Spain
+- (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzˇn
-+ Send your questions to the group, not to my mailbox

Re: Open_basedir restriction in effect

Quoted text here. Click to load it

Figured it out, had to change my temp folder to something else (a
previous programmer had set this script up) and change the permissions
on the temp folder to make it writable.

Site Timeline