Roundcube Community Forum

 

File upload failed

Started by trax, April 20, 2009, 09:38:06 AM

Previous topic - Next topic

trax

Hi everybody

I have a roblem when trying to upload a file as an attachment, size doesn't matter. I can Select the file and in the moment i click "upload" a red status bar on the top appears and tells: "File upload failed".

I have the temp dir configured as temp/ and it is writable. It even creates a file in the temp dir, but this file is only "touched" and remains 0KB.

I can not find anything in the logs.. does someone have an idea?

cheers

rosali

Which OS? Windows? Official RoundCube releases need full path for windows (C:/temp).
Regards,
Rosali

trax

Hey, sorry for that, seems like i'm a little lazy today...

uname -a
Linux hostname 2.6.18-5-686-bigmem #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux

apache2 -V
Server version: Apache/2.2.3
Server built:   Sep  6 2008 09:52:20
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"


php -v
PHP 5.2.0-8+etch13 (cli) (built: Oct  2 2008 08:26:18)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

cat index.php | grep Version
 | Version 0.2.1                                                           |

after trying to upload a file, my temp dir looks like that:

ls -lah temp
total 12K
drwxrwxr--  2 www-data vu2005   4.0K 2009-04-20 16:21 .
drwxrwx--- 11 vu2005   www-data 4.0K 2009-04-20 16:19 ..
-rw-r--r--  1 vu2005   vu2005     32 2009-04-17 14:10 .htaccess
-rw-------  1 www-data www-data    0 2009-04-20 16:21 rcmAttmntrhpc26


cat config/main.inc.php | grep temp/
$rcmail_config['temp_dir'] = 'temp/';


any ideas?

thanks :)

rosali

JohnDoh? I'm not a Linux guy.
Regards,
Rosali

Julius Caesar

Quote from: trax;18564php -v
PHP 5.2.0-8+etch13 (cli) (built: Oct  2 2008 08:26:18)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

If I check the wiki, the minimum requirement for PHP is version 5.2.1 and not 5.2.0. But the install info just speaks of v5.2. Maybe here is a problem.
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

trax

Okay, it was a PHP misconfiguration:

upload_tmp_dir = /tmp/ was not set in php.ini, then the system took the system default, wich is /tmp (without trailing slash). And then:

[Mon Apr 20 16:21:06 2009] [error] [client X] PHP Warning:  Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/virtual/foo.ch/webmail/:/usr/share/php/:/tmp/) in Unknown on line 0, referer: http://webmail.foo.ch/?_task=mail&_id=62217413149ec84c9d7fb2&_action=compose
[Mon Apr 20 16:21:06 2009] [error] [client X] PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0, referer: http://webmail.foo.ch/?_task=mail&_id=62217413149ec84c9d7fb2&_action=compose

And open_basedir was not defined in php.ini.

It works now, but i still wonder why PHP tries to safe stuff in /tmp/, although i configured temp/ in the roundcube config..??

Thanks a lot & happy uploading, Simon

Julius Caesar

Quote from: trax;18582but i still wonder why PHP tries to safe stuff in /tmp/, although i configured temp/ in the roundcube config..??

Because the actual upload is a php-action, which uses the setting for temporary files in the PHP.ini and saves it in the location defined in the RoundCube config. Each of these temp locations has it's own purpose.
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he