Login or Register

RSS IconRecent posts in this topic

avatar
cubetto on Nov 8. 2006. 12:49 pm
i get an error creating folder '.../activeCollab/upload/b345d/76e2d/24011' whenever i try to upload files... i can upload user thumbnails so its not a permission problem

apache 2, php 5, mysql 5 on centos 4
avatar
Ilija Studen on Nov 8. 2006. 1:03 pm
Actually, it is permission related - when PHP creates a folder it is created with a owner that PHP can't modify. Is it your server?

Solution might be to use MySQL storage engines for files. Open config_options table and set value of option named "file_storage_adapter" to "mysql". Any previously uploaded files will not be moved to new storage engine.
activeCollab team member | LinkedIn
avatar
cubetto on Nov 10. 2006. 1:45 pm
the issue is in this function

function force_mkdir($path, $chmod = null) {
    if(is_dir($path)) return true;
    $real_path = str_replace('\\', '/', $path);
    $parts = explode('/', $real_path);

    $forced_path = '';
    foreach($parts as $part) {
      // Skip first on windows
      if($forced_path == '') {
        $start = substr(__FILE__, 0, 1) == '/' ? '/' : '';
        $forced_path = $start . $part;
      } else {
        $forced_path .= '/' . $part;
      } // if
      if(!is_dir($forced_path)) {
        if(!is_null($chmod)) {
          if(!mkdir($forced_path)) return false;
        } else {
          if(!mkdir($forced_path, $chmod)) return false;
        } // if
      } // if
    } // foreach
    return true;
  } // force_mkdir



basically it runs an is_dir to "/" which collides win an open_basedir restriction

you should start is_dir in the app base folder, i'll try to provide a patch during the weekend

i found it here:

#1 ERROR: Error: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/httpd/vhosts/*/subdomains/collab/activeCollab:/tmp) in '/home/httpd/vhosts/*/subdomains/collab/activeCollab/environment/functions/files.php' on line 241 (error code: 2)
avatar
ripemedia on Nov 14. 2006. 7:59 pm
Is there a fix for this yet? I'm having the same problem.
avatar
Ilija Studen on Nov 14. 2006. 11:53 pm
Ticket #197
activeCollab team member | LinkedIn
avatar
interactive on Feb 1. 2007. 11:25 am
no fix yet ? The ticket#197 goes to an error page.
avatar
viceroy321 on Feb 1. 2007. 3:59 pm
trac is down again...
avatar
Ilija Studen on Feb 1. 2007. 4:32 pm
viceroy321:
trac is down again...


It keeps crashing. I asked support and they told me that they'll check it out but problem persists. I'll send another email and we'll see what happens.
activeCollab team member | LinkedIn
avatar
mvdbrand on May 7. 2007. 2:31 pm
I don't get what I have to do to fix this. Can somebody please help me.

mvdbrand
avatar
senixon on May 24. 2007. 4:57 pm
@mvdbrand:

Are you on Windows or Lunux? What PHP version do you have?
I have a solution that works perfectly on a Windows 2003 server with PHP 5.1.x, try my solution and let me know if it worked!

Go into [activeCollab Intall directory]/environment/functions/files.php and replace the 'force_mkdir' function with my solution...

function force_mkdir($path, $chmod = null) {	
	$real_path = str_replace(getcwd(), '', $path);
	$real_path = str_replace('\\', '/', $real_path);
    if(is_dir($real_path)) return true; 
    $parts = explode('/', $real_path);
	    
	$forced_path = '';	
    foreach($parts as $part) {
      
      // Skip first on windows
      if($forced_path == '') {		
        $start = substr(__FILE__, 0, 1) == '/' ? '/' : '';
        $forced_path = $start . $part;
      } else {		
        $forced_path .= '/' . $part;
      } // if
      
      if(strlen(trim($forced_path)) > 0 && !is_dir($forced_path)) {
        if(!is_null($chmod)) {
          if(!mkdir($forced_path)) return false;
        } else {
          if(!mkdir($forced_path, $chmod)) return false;
        } // if
      } // if
    } // foreach
    
    return true;
  } // force_mkdir

RSS IconRecent posts in this topic