Table of contents ▼▲
Bug 29 - Warnings and command failure in safe mode
This is due to certain commands being removed from 'safe-mode' php installs. The two that appear to be causing problems are 'ini-set' and 'realpath'. I will look at what can be done to work around this... darren
Example site can be found at http://members.lycos.co.uk/dennyhalim/WikiDX
To get round the ini_set problems, simply uncomment the ini_set lines out of wikidx.php.
I am currently testing an alternative to realpath function...
Try the following please...
Have you tried this yet? Some feedback would be useful....
Add the following function to wikidx.php and change calls to realpath to use realpath2 instead. This works in my test environment..
function realpath2($path)
{
////check if realpath is working
if (strlen(@realpath($path))>0)
return realpath($path);
///if its not working use another method///
$p=getenv("PATH_TRANSLATED");
$p=str_replace("\\","/",$p);
$p=str_replace(basename(getenv("PATH_INFO")),"",$p);
$p.="/";
if ($path==".")
return $p;
//now check for back directory//
$p=$p.$path;
$dirs=split("/",$p);
foreach($dirs as $k => $v) {
if ($v=="..") {
$dirs[$k]="";
$dirs[$k-2]="";
}
}
$p="";
foreach($dirs as $k => $v) {
if (strlen($v)>0)
$p.=$v."/";
}
$p=substr($p,0,strlen($p)-1);
if (is_dir($p))
return $p;
if (is_file($p))
return $p;
return false;
}