Author Topic: upload_max_filesize attachment  (Read 8452 times)

Offline gertudby

  • Newbie
  • *
  • Posts: 5
upload_max_filesize attachment
« on: December 08, 2009, 12:40:57 PM »
Hi
I have the following settings

php.ini
----------------
; Maximum size of POST data that PHP will accept.
post_max_size = 18M

; Maximum allowed size for uploaded files.
upload_max_filesize = 11M
----------------

.htaccess  (roundcubemail-0.2.1/.htaccess)
----------------
php_value       upload_max_filesize     5M
php_value       post_max_size   6M
php_value       memory_limit    64M
----------------

Even though I have a max limit on attachment at 2 Mb
Can anybody tell me or guide me in the right direction ?:)

Best Regards
Gert

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development

Offline gertudby

  • Newbie
  • *
  • Posts: 5
upload_max_filesize attachment
« Reply #2 on: December 08, 2009, 02:37:09 PM »
thanks for the reply :)

I tried with the following settings

-----------------
my php.ini

max_execution_time = -1
max_input_time = -1
memory_limit = 384M
post_max_size = 27M
file_uploads = On
upload_max_filesize = 25M

my .htaccess

php_value upload_max_filesize 25M
php_value post_max_size 27M
php_value memory_limit 384M
-----------------

I use RHEL, do you know any services I need to restart for it to work ? in other words, the settings above doesn't work.

BR
Gert

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
upload_max_filesize attachment
« Reply #3 on: December 08, 2009, 02:41:36 PM »
Is there anything in your RoundCube error log?

Offline gertudby

  • Newbie
  • *
  • Posts: 5
upload_max_filesize attachment
« Reply #4 on: December 08, 2009, 03:25:17 PM »
I get this error msg
------------
[08-Dec-2009 21:12:20] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 4737171 bytes) in /export/www/doc/webmail/public_html/rc/program/lib/Net/SMTP.php on line 831
------------

I have these settings in
----------------

function data($data)
    {
        /* RFC 1870, section 3, subsection 3 states "a value of zero
         * indicates that no fixed maximum message size is in force".
         * Furthermore, it says that if "the parameter is omitted no
         * information is conveyed about the server's fixed maximum
         * message size". */
        if (isset($this->_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) {
            if (strlen($data) >= $this->_esmtp['SIZE']) {
                $this->disconnect();
                return PEAR::raiseError('Message size excedes the server limit');
            }
        }h
----------------

Offline gertudby

  • Newbie
  • *
  • Posts: 5
upload_max_filesize attachment
« Reply #5 on: December 08, 2009, 04:52:18 PM »
Hi
I found a solution ;D

-----------------------
my php.ini

max_execution_time = -1
max_input_time = -1
memory_limit = 512M
post_max_size = 128M
file_uploads = On
upload_max_filesize = 96M

my .htaccess

php_value upload_max_filesize 96M
php_value post_max_size 128M
php_value memory_limit 512M
------------------------

Just tried with a 25Mb file, and it worked :)

stumbled over this FAQ  FAQ ? Roundcube Webmail

Can'I send messages with large attachments

The outgoing message is entirely composed in memory of the PHP process. Some PHP installations limit the amount of memory a single process can allocate. This will result in error messages like

PHP Fatal error: Allowed memory size of 16108864 bytes exhausted (tried to allocate ....

You need to increase the allowed memory size in php.ini or in the local .htaccess file by setting memory_limit 64M or even higher. It's actually a known problem (#1484660 (Attachment Excessive Memory Use Error) ? Roundcube Webmail) and we're looking for a better library than PEAR::Mail_mime to solve this.

Offline gertudby

  • Newbie
  • *
  • Posts: 5
upload_max_filesize attachment
« Reply #6 on: December 08, 2009, 05:39:21 PM »
decreased the attachment to

my php.ini

max_execution_time = -1
max_input_time = -1
memory_limit = 128M
post_max_size = 18M
file_uploads = On
upload_max_filesize = 11M

my .htaccess

php_value upload_max_filesize 11M
php_value post_max_size 18M
php_value memory_limit 128M

it worked with 10Mb file, but rc said can't attach 13mb (in the gui, not just the stalling message "sending message" forever)

Tried to decrease the memory_limit to 64M but then I couldn't even send a 8Mb file even though upload_max_filesize were 11M

Fan-bloody-tastic ;D

Thanks for the errorlog hint