File Uploading
Page: 1, 2
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
apache 2, php 5, mysql 5 on centos 4
the issue is in this function
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)
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_mkdirbasically 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)
I don't get what I have to do to fix this. Can somebody please help me.
mvdbrand
mvdbrand
@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...
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



