Author Topic: Attachment file size increase - Simple steps please  (Read 18305 times)

Offline bobg

  • Jr. Member
  • **
  • Posts: 13
Attachment file size increase - Simple steps please
« on: February 19, 2010, 05:02:04 AM »
I appreciate this issue has been discussed in the past, but I need help with php.ini, etc, to increase attachment size to, say, 10Mb.
I am a reseller, installing RoundCube for the first time into a public_html/webmail folder at each of my hosted domains. I can see several .htaccess files, but I can't see a php.ini. I've created a new php.ini containing:
[PHP]
; Increase maximum post size
post_max_size = 25M

; Increase maximum upload size
upload_max_filesize = 25M

and dropped it into several locations, but everytime I try to send an attachment RoundCube still says my limit is 2.0Mb. My hosting company say it's a simply question of creating a php.ini file (I'm apparantly using php4), but no joy. I don't have access to folders such as apache/etc and so on.
Can anyone provide me with simple steps here. Thank you, Bob.

Offline bagu

  • Full Member
  • ***
  • Posts: 109
    • Bagu.biz
Attachment file size increase - Simple steps please
« Reply #1 on: February 19, 2010, 07:30:19 AM »
No need to create a php.ini.
Just edit the .htaccess file.

Offline bobg

  • Jr. Member
  • **
  • Posts: 13
Doesn't seem to work?
« Reply #2 on: February 19, 2010, 08:37:37 AM »
Many thanks, Bagu
My .htaccess file contains the following lines:


php_value   upload_max_filesize   5M
php_value   post_max_size      6M
php_value   memory_limit      64M

What values would you suggest for 10Mb uploads, please. Also, if the values above are currently 5M and 6M, are you able to explain please the message that appears in RoundCube when I go to add an attachment is: "Maximum allowed file size is 2.0MB". Also, when I just tried to add a 3.7Mb attachment, the file was not attached, and the message was sent without it.
Any help would be appreciated. Many thanks, Bob.

Offline bagu

  • Full Member
  • ***
  • Posts: 109
    • Bagu.biz
Attachment file size increase - Simple steps please
« Reply #3 on: February 19, 2010, 08:41:36 AM »
Here are my value :
php_value   upload_max_filesize   16M
php_value   post_max_size      16M
php_value   memory_limit      128M

But, if you are reseller, it's possible that you can't change settings set in php.ini of your host.
« Last Edit: February 19, 2010, 09:13:18 AM by bagu »

Offline bobg

  • Jr. Member
  • **
  • Posts: 13
Hosting company say create my own php.ini if necessary
« Reply #4 on: February 19, 2010, 09:04:02 AM »
Hi Bagu
Thanks for the reply. Yes, It does look like I need to amend or add a php.ini file somewhere. My hosting company say that all I need to do, if there isn't one, is to create one, and it would override their server settings. I do wonder if they have got that wrong, though. I have tried creating what looks like a proper php.ini file, using parameters found elsewhere on this forum, and have dropped the file into several RC folders, but this doesn't change the message about the 2.0MB limit. Thanking you in anticipation, Bob.

Offline bagu

  • Full Member
  • ***
  • Posts: 109
    • Bagu.biz
Attachment file size increase - Simple steps please
« Reply #5 on: February 19, 2010, 09:12:46 AM »
Here is my php.ini settings for roundcube:
post_max_size = 16M
upload_max_filesize = 16M
max_input_time = 180
memory_limit = 128M
max_execution_time = 180

Offline bobg

  • Jr. Member
  • **
  • Posts: 13
Where shall I place the php.ini file?
« Reply #6 on: February 19, 2010, 09:33:36 AM »
Bagu, you've been great - thank you. Hopefully, one last question. Where have you placed the php.ini file. On each of my hosting accounts, I have created a folder called 'webmail', as a sub-folder of the root for the hosting, called public_html (pretty standard, I think) - public_html/webmail. Within the webmail folder are the 9 RoundSube sub-folders: bin, config, logs, plugins, program, skins, SQL, temp and _files. Is this the same for you? If so, where should I place php.ini - in one of the sub-folders? In the webmail folder itself, perhaps? I appreciate your help, thank you. Bob

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Attachment file size increase - Simple steps please
« Reply #7 on: February 19, 2010, 11:44:38 AM »
It should be placed in RoundCube's root folder.

Offline bobg

  • Jr. Member
  • **
  • Posts: 13
Cracked it: PHP5.INI not PHP.INI
« Reply #8 on: February 20, 2010, 12:24:33 PM »
I've finally solved the problem, and I can now attach files greater than a total limit of 2.0Mb. The solution was to rename the file php.ini to php5.ini (and place it in the root folder of RoundCube, along with .htaccess). By default, my hosting company supplies PHP version 4 (with the option of changing to version 5). I had learnt that for version 4, the file should be called php.ini, whilst if using PHP version 5, then the file should be called php5.ini. Naturally, I called the file php.ini as my hosting company was providing PHP version 4 by default. I then spotted the statement at the top of .htaccess: SetEnv DEFAULT_PHP_VERSION 5, which apparantly forces PHP to work as version 5. Putting 2 and 2 together, I then renamed php.ini to php5.ini, and I can now send files up to 16Mb in (total) size - using the following statements:

The .htaccess file:
php_value upload_max_filesize 16M
php_value post_max_size 16M
php_value memory_limit 128M

The php5.ini file (containing no more than the following lines):
post_max_size = 16M
upload_max_filesize = 16M
max_input_time = 180
memory_limit = 128M
max_execution_time = 180

Many thanks to all, Bob.

Offline ploum

  • Newbie
  • *
  • Posts: 7
Attachment file size increase - Simple steps please
« Reply #9 on: April 22, 2010, 09:33:54 AM »
I don't understand how you can have a php.ini in your roundcube folder. php.ini is in /etc, isn't it ?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Attachment file size increase - Simple steps please
« Reply #10 on: April 23, 2010, 03:19:57 AM »
Some servers use a php.ini file to override setting instead of a .htaccess

Offline mackal

  • Newbie
  • *
  • Posts: 2
Re: Attachment file size increase - Simple steps please
« Reply #11 on: May 02, 2015, 03:51:53 PM »
I solved this problem, because in my case the above solution does not work. You have change one more file the settings in the /etc/roundcube/htaccess. For more information, visit http://maciej.pawlikowice.info/artykuly/36-linux/82-roundcube-zmiana-rozmiaru-maksymalnego-wysylanych-zalacznikow
« Last Edit: May 02, 2015, 03:57:47 PM by mackal »

Offline jacco

  • Newbie
  • *
  • Posts: 1
Re: Attachment file size increase - Simple steps please
« Reply #12 on: October 14, 2015, 09:39:44 PM »
I spent the last 30 min or so struggling with this issue before finally figuring it out. Since I did not find this documented anywhere yet I'll post it here, hopefully reducing someone else's suffering... I'm migrating our Roundcube to a RHEL6-based server (from openSUSE), on which newer versions of some packages were installed from a rhscl distribution channel (the default RHEL6 php is v5.3 I think). This 'offical RH hack' installs this non-standard stuff under /opt/rh/, in this case /opt/rh/php55/root/, so changing the standard /etc/php.ini does not do anything, php5.5 uses /opt/rh/php55/root/etc/php.ini instead... :-\ (Like my apache 2.4 stuff is under /opt/rh/httpd24/root/, etc.)