OwnCloud: PHP file upload limit 2M

Discussion in 'General' started by Quaxth, Jan 21, 2014.

  1. Quaxth

    Quaxth Member

    I installed OwnCloud 6.0.0a Stable and it works. Only problem so far is that the Limit for file upload is set to 2MB and that I couldn't change. I do had changed the upload limits in php.ini to 1GB and memory use to 512MB but the set ettings in OwnCloud still remaining to 2MB upload files size.

    Any Idea what I could do else?

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which php mode do you use and in which php.ini file did you change the limit? Did you restart apache and php-fpm? Do you use custom php.ini settings in that website?
  3. Quaxth

    Quaxth Member

    I use suPHP, I changed the limits in all php.ini files started with the one in /php5/apache2 and I also hard restarted the server after the restart of apache2 and php-fpm wasn't working! I wasn't found the php.ini in OwnCloud folder but it should be set by default to 512MB according to the documentation.

    Unfortunately the forum of that site isn't very helpful. I asked the question there several times already and didn't get an answer. That's why I finally asked here!

  4. Quaxth

    Quaxth Member

    I just checked the folder of OwnCloud again and the only file I found were .htaccess and in that file the upload limit is set to 512MB

    <IfModule mod_fcgid.c>
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
    RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    ErrorDocument 403 /oc/core/templates/403.php
    ErrorDocument 404 /oc/core/templates/404.php
    <IfModule mod_php5.c>
    php_value upload_max_filesize 512M
    php_value post_max_size 512M
    php_value memory_limit 512M
    php_value mbstring.func_overload 0
    <IfModule env_module>
      SetEnv htaccessWorking true
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L]
    RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
    RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
    RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
    RewriteRule ^remote/(.*) remote.php [QSA,L]
    <IfModule mod_mime.c>
    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz
    <IfModule dir_module>
    DirectoryIndex index.php index.html
    AddDefaultCharset utf-8
    Options -Indexes
    Also the post_max_size is set to 1GB too. So that matched the upload size limit!
    Last edited: Jan 21, 2014
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Change php mode to php-fcgi. This mode should be used for all sites. suphp is outded, very slow and should not be used anymore.
    2) enable suexec in the website settings.
    3) Edit the php.ini file in /etc/php5/cgi/
    4) Restart apache

    In case that you have ay settings in the custom php.ini field of the website, then youll have to change the upload file size ther and not in the global php.ini, as custom php.ini overrides global settings.

    The php settings .htaccess file from Ownclod dont matter, thy will net get applied to php.
  6. Quaxth

    Quaxth Member

    To 1.)
    unfortunately there some Scripts which still need suPHP for to work correctly. Anyway, I'll change it and see that will works and hopefully the apps I needed suPHP for will still work?!

    To 2.)
    suexec is enabled already

    To 3.)
    That I've edited already and changed the settings as well. So it should be OK!

    There isn't an php.ini on OwnCloud folder! I checked every sigle folder in there: NO php.ini! Or could that on an different place?

    OK, will change the suPHP now to php-fcgi and see what happen.
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I talked about the .htaccess file that you posted, not a php.ini. A php.ini in a owncloud folder wont make sense.
  8. Quaxth

    Quaxth Member

    I didn't found php-fcgi!!
    I got this:


    Which I should chose now: Fast-CGI or PHP-FPM?

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    fast-cgi is php-fcgi.
  10. Quaxth

    Quaxth Member

    Thanks for that!

    I would just to be clear and not use the wrong one.:)

    Will change now!
  11. Quaxth

    Quaxth Member

    OK!! Now it's working and shows 1GB:


    Thanks a lot Till and now it's time for to go sleep 0:12 already (in Thailand)!!

    Thanks a lot and cheers.
  12. craig baker

    craig baker Member HowtoForge Supporter

    Owncloud max upload size

    you will find owncloud cannot upload a file > 2gb (no matter WHAT your settings are).

    when you edit your php.ini you will discover that changing post_max_size and Upload_max_filesize to 0 (rather than any size). you can now upload huge files.

    however - in my case doing this (editing /etc/php.ini) lead to other issues - it broke wordpress for example.

    now if you are not considering uploading bigger files - no problem.

Share This Page