Author Topic: Uploadign of files error  (Read 28594 times)

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Uploadign of files error
« Reply #15 on: September 15, 2008, 09:12:32 am »
If you are using DB storage this could be it:
Quote
The server's default max_allowed_packet  value is 1MB.
http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html
or else the problem could be not setting setting "php_value memory_limit" to a big enough value (32M sound OK for your case).
If it does not work let me know ...
Marcos

editfish

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Uploadign of files error
« Reply #16 on: September 16, 2008, 12:18:46 am »
The uploading is a relatively minor feature for my usage of the app itself, so I think I'm gonna have to give up on that aspect for now.  :P

My .htaccess was already set for php_value memory_limit 32M; I doubled it for fun with the same result.  No change to the log.php except the usual:

-------------------------------------------------------------------------------
Session "default" started at 2008-09-16T02:19:49+0000
#1 DEBUG: WARNING: Calling getProject() on an object with multiple workspaces.
Time since start: 0.980235099792 seconds
-------------------------------------------------------------------------------


Ugh.  :(

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #17 on: November 13, 2008, 06:30:33 pm »
hey there,

i am new to opengoo and i really like it.
i also have this upload problem.
my log file sais:

Session "default" started at 2008-11-13T21:26:29+0000
#1 ERROR: Error: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/var) is not within the allowed path(s): (...) in '/.../opengoo/environment/functions/files.php' on line 241 (error code: 2)
#2 ERROR: Error: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: open_basedir restriction in effect. File(/var) is not within the allowed path(s): (...) in '.../opengoo/environment/functions/files.php' on line 243 (error code: 2)
Time since start: 0.190006971359 seconds
-------------------------------------------------------------------------------


i actually understand the error message but i dont understand why opengoo even tries to list /var ???
why doesn't it try listing at the opengoo upload dir?

thanks & greets,
soomon

man2004

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Uploadign of files error
« Reply #18 on: November 13, 2008, 11:07:22 pm »
Do you also need to change the upload limit in php.ini?

upload_max_filesize = 16M

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #19 on: November 14, 2008, 02:23:33 am »
i already did.. but i want to use the filesystem to upload files instead of the database...

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #20 on: November 15, 2008, 06:22:51 pm »
any news on this?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Uploadign of files error
« Reply #21 on: November 16, 2008, 10:52:44 am »
I have no idea of what could be causing this. OpenGoo shouldn't be trying to write to /var. Where did you download OpenGoo from? (just a paranoic question :))

What version of PHP and Apache are you using? Did you try Googling this error? Maybe it's a generic error and not related to OpenGoo.

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #22 on: November 16, 2008, 12:09:35 pm »
hi,

i downloaded it from sourceforge (link from you homepage),
seems to be the same problem like tiaan has (first page of this thread, opengoo trying to list /home instead of his homedir).
maybe some inaccuracy in the code?
or is there some specific variable used?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Uploadign of files error
« Reply #23 on: November 16, 2008, 01:02:05 pm »
Ok, OpenGoo is trying to read on /var because it is installed somewhere under /var (maybe /var/www). As Marcos said in a previous post this is related to your PHP safe mode configuration.

Anyway, I think this might fix it: Change line 11 of 'init.php' from:
Code: [Select]
define('FILES_DIR',        ROOT . '/upload'); // place where we will upload project files
to:
Code: [Select]
define('FILES_DIR',        'upload'); // place where we will upload project files

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #24 on: November 16, 2008, 01:32:56 pm »
ok just tried that:
when i only use 'upload'
#1 ERROR: Error: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/upload) is not within the allowed path(s)

/upload? :S

when i insert the full path:  define('FILES_DIR',        '/var/www/virtual/soomon.de/htdocs/opengoo/upload');
i again get:
#1 ERROR: Error: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/var) is not within the allowed path(s):

also when i change ROOT to /var/www/virtual/soomon.de/htdocs/opengoo/
and upload dir to /upload

why does opengoo even try to read on /var and not on it's root directory
/var/www/virtual/soomon.de/htdocs/opengoo
?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Uploadign of files error
« Reply #25 on: November 16, 2008, 03:16:40 pm »
It's because there's a function that, given a path, it creates all missing directories on that path. In this function then, it needs to check whether each directory in the path exists, and when it checks if "/var" is a directory your PHP is throwing the error.

Try this:

Code: [Select]
define('FILES_DIR',        './upload'); // place where we will upload project files
If that doesn't work I have another soultion waiting.

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #26 on: November 16, 2008, 03:31:47 pm »
open_basedir restriction in effect. File(/.) is not within the allowed path(s):

but does it really need to check if /var exists if opengoo is in /var/www/opengoo ?
maybe it's important to tell you that i run ispcp on my server.
but that didn't cause any problems with webapps yet..

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Uploadign of files error
« Reply #27 on: November 16, 2008, 04:07:20 pm »
Add this to 'environment/functions/files.php':
Code: [Select]
function force_mkdir_from_base($base, $path, $chmod = null) {
    if(is_dir(with_slash($base).$path)) return true;
    $real_path = str_replace('\\', '/', $path);
    $parts = explode('/', $real_path);
   
    $forced_path = '';
    foreach($parts as $part) {
        if($part !='')
        {
              // Skip first on windows
              if($forced_path == '') {
                $forced_path = with_slash($base) . $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
        } // if
    } // foreach

and change line 165 of 'library/filerepository/backend/FileRepository_Backend_FileSystem.class.php' from:
Code: [Select]
if(!force_mkdir($destination_dir, 0777)) {to:
Code: [Select]
if(!force_mkdir_from_base($this->getRepositoryDir(), dirname($this->idToPath($file_id)), 0777)) {
and revert changes to 'init.php':
Code: [Select]
define('FILES_DIR',        ROOT . '/upload'); // place where we will upload project files
« Last Edit: November 16, 2008, 04:28:10 pm by ignacio »

soomon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Uploadign of files error
« Reply #28 on: November 16, 2008, 04:41:26 pm »
it's till trying to write to / or /var which ofc gets the same error :S

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Uploadign of files error
« Reply #29 on: November 16, 2008, 05:55:03 pm »
 :'(

What does the error message say now?