I had the same problem like many other members with open_basedir restriction and this fix worked for me like a charm on my fedora box...
- First locate activecollab\environment\functions folder and open the file "files.php".
- Find the function force_mkdir and change this line:
if(!is_dir($forced_path)) {
to:
if(!my_is_dir($forced_path)) {
* note that we added "my_" prefix on "is_dir" function.
- Add this new function just below force_mkdir to bypass open_basedir restrictions:
function my_is_dir($dir)
{
// bypasses open_basedir restrictions of is_dir and fileperms
$tmp_cmd = `ls -dl $dir`;
$dir_flag = $tmp_cmd[0];
if($dir_flag!="d")
{
// not d; use next char (first char might be 's' and is still directory)
$dir_flag = $tmp_cmd[1];
}
return ($dir_flag=="d");
}
I don't understand well this issue. Example: My database prefix name, anathema_ so i have to use it like this : anathema_is_dir and change all my_ to anathema_ is it true?
And i don't understand well where i have to add these codes :
function my_is_dir($dir)
{
// bypasses open_basedir restrictions of is_dir and fileperms
$tmp_cmd = `ls -dl $dir`;
$dir_flag = $tmp_cmd[0];
if($dir_flag!="d")
{
// not d; use next char (first char might be 's' and is still directory)
$dir_flag = $tmp_cmd[1];
}
return ($dir_flag=="d");
}
function my_is_dir($dir)
{
// bypasses open_basedir restrictions of is_dir and fileperms
$tmp_cmd = `ls -dl $dir`;
$dir_flag = $tmp_cmd[0];
if($dir_flag!="d")
{
// not d; use next char (first char might be 's' and is still directory)
$dir_flag = $tmp_cmd[1];
}
return ($dir_flag=="d");
}
Topic is locked
If you have something important to say about the issues discussed in this post please write at hi@a51dev.com.
- First locate activecollab\environment\functions folder and open the file "files.php".
- Find the function force_mkdir and change this line:
if(!is_dir($forced_path)) {
to:
if(!my_is_dir($forced_path)) {
* note that we added "my_" prefix on "is_dir" function.
- Add this new function just below force_mkdir to bypass open_basedir restrictions:
function my_is_dir($dir)
{
// bypasses open_basedir restrictions of is_dir and fileperms
$tmp_cmd = `ls -dl $dir`;
$dir_flag = $tmp_cmd[0];
if($dir_flag!="d")
{
// not d; use next char (first char might be 's' and is still directory)
$dir_flag = $tmp_cmd[1];
}
return ($dir_flag=="d");
}
- Save and upload.
*****
Great work, Ilija!!! Take care!