skip to Main Content

Warning: touch() [function.touch]: open_basedir restriction in effect.
File() is not within the allowed path(s):
(/var/www/vhosts/site.com/httpdocs/) in
/var/www/vhosts/site.com/httpdocs/Manuals/updater.php on line 5 There
was an error loading your Manual, please press the back button and try
again.

im trying to figure out why the heck this isn’t working – currently, I am using plesk, and it is set to default, which should be working as this is within a subdirectory of the httpdocs…

any ideas?

UPDATER.PHP

<?php
//    $URL="manualframe.php";
$URL=$_GET["URL"];
//    header( 'Location: '.$URL.'' ) ;
if (touch($URL)) {
echo 'loading!';
} else {
echo 'There was an error loading your Manual, please press the back button and try again.';
}
echo '<meta http-equiv="refresh" content="1;URL='.$URL.'">';
?>

2

Answers


  1. Would the Manuals directory be a symlink to a directory outside the webroot by any chance?

    open_basedir is also in effect on symlinks within your allowed path(s).

    See the PHP manual on open_basedir for more information, which states:

    When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it’s not possible to avoid this restriction with a symlink. If the file doesn’t exist then the symlink couldn’t be resolved and the filename is compared to (a resolved) open_basedir .

    Login or Signup to reply.
  2. Looks like PHP is running in Safe Mode. This restriction means you can’t read any files outside your web root. That’s probably what updater.php is trying to do.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search