Announcement

Collapse
No announcement yet.

Cannot upload attachments around 1MB in size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot upload attachments around 1MB in size

    I'm trying to get attachments to upload and I have no issues if it less than 1MB but anything around that size and larger give a Database error. I found several threads with similar issues and I had my Server Admin check the settings for size and time limits and that is not the issue.

    I'm running 3.6.7 PL1 with vBa CMPS and a purchased skin, no other mods.

    Anything else I can try? The site is at: ww.rafaelbeerphotography.com/yearbook

    Thanks!

  • #2
    First, check your attachment size setting in the Admin CP and make sure it's large enough. If that is fine, then you need to change the upload size for both PHP and for MySQL. You need to have root access to the server to do this. Make these changes to php.ini:

    upload_max_filesize = xM

    ..and my.cnf (or my.ini for Windows systems)

    set-variable=max_allowed_packet=xM

    Change it to the size ('x') you want in Megabytes. Restart the webserver and MySQL after making these changes.

    Note: You may also need to increase the max_execution_time and max_input_time variables in php.ini.

    Also you might want to take a look at this for other settings that affect file uploads:

    http://www.vbulletin.com/forum/showp...0&postcount=12
    http://www.vbulletin.com/forum/showt...319#post748319
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      I just got this back from my host, they said they increased all of the settings to this:

      max_execution_time 40 40
      max_input_time 160 160
      post_max_size 200M 200M

      upload_max_filesize 200M 200M

      Comment


      • #4
        You should be fine uploading larger files now.
        Kerry-Anne :)

        Twitter Blog

        www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

        Comment


        • #5
          Same problem. Database error. Then I get these huge 11mb or more emails at the admin email containing a bunch of jibberish.

          Comment


          • #6
            Are you storing your attachments in the database or file system?

            What is the last 10 lines of the database error?
            Kerry-Anne :)

            Twitter Blog

            www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

            Comment


            • #7
              I can't even copy the contents of the Error box, it takes forever loading and seems to freeze up the browser window...I'll try again. They are being stored in the Database I believe. Which category is the setting under?

              Comment


              • #8
                AdminCP > Attachments > Attachment Storage Type.

                Without the actual error being received it is impossible to diagnose further and so we will need to know the actual error being received.
                Kerry-Anne :)

                Twitter Blog

                www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

                Comment


                • #9
                  I suspect the server simply says "MySQL has gone away" or something like that.

                  Ask your hosting provider to check the MySQL errors, perhaps they can see why mysql has shut down. As root user they have access to the log files on their system.

                  Comment


                  • #10
                    Also a max_execution_time of 40 may not be sufficient for a 1MB file. I recommend at least 240.
                    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                    Change CKEditor Colors to Match Style (for 4.1.4 and above)

                    Steve Machol Photography


                    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                    Comment


                    • #11
                      What would be a good setting for a 5MB file? I will ask them to check the mysql logs. They sent me this yesterday as the settings for mysql:


                      #[mysqld]
                      #set-variable = max_connections=500
                      #safe-show-database

                      [mysqld]
                      #port = 3306
                      #socket = /var/lib/mysql/mysql.sock
                      #datadir=/var/lib/mysql/data
                      #skip-locking
                      #skip-innodb
                      # MySQL 4.x has query caching available.
                      # Enable it for vast improvement and it may be all you need to tweak.
                      query_cache_type=1
                      query_cache_limit=1M
                      query_cache_size=32M
                      # max_connections=500
                      # Reduced to 200 as memory will not be enough for 500 connections.
                      # memory=key_buffer+(sort_buffer_size+read_buffer_size)*max_connections
                      # which is now: 64 + (1 + 1) * 200 = 464 MB
                      # max_connections = approx. MaxClients setting in httpd.conf file
                      # Default set to 100.
                      #max_connections=200
                      #interactive_timeout=180
                      interactive_timeout=100
                      #wait_timeout=180
                      #wait_timeout=100
                      # Reduced wait_timeout to prevent idle clients holding connections.
                      #wait_timeout=30
                      wait_timeout=15
                      connect_timeout=10
                      # max_connect_errors is set to 10 by default
                      #max_connect_errors=10
                      #table_cache=256
                      #table_cache=1024
                      # Checked opened tables and adjusted accordingly after running for a while.
                      table_cache=512
                      #tmp_table_size=32M by default
                      #thread_cache=128
                      # Reduced it to 32 to prevent memory hogging. Also, see notes below.
                      thread_cache=32
                      # key_buffer=258M
                      # Reduced it by checking current size of *.MYI files, see notes below.
                      key_buffer=128M
                      # Commented out the buffer sizes and keeping the default.
                      # sort_buffer_size=2M by default.
                      #sort_buffer_size=1M
                      # read_buffer_size=128K by default.
                      #read_buffer_size=1M
                      # read_rnd_buffer_size=256K by default.
                      #read_rnd_buffer_size=1M
                      # myisam_sort_buffer_size=8M by default.
                      #myisam_sort_buffer_size=64M
                      # thread_concurrency = 2 * (no. of CPU)
                      thread_concurrency=2
                      # log slow queries is a must. Many queries that take more than 2 seconds.
                      # If so, then your tables need enhancement.
                      log_slow_queries=/var/log/mysqld.slow.log
                      long_query_time=2

                      #[mysql.server]
                      #user=mysql
                      #basedir=/var/lib/mysql

                      [safe_mysqld]
                      err-log=/var/log/mysqld.log
                      pid-file=/var/run/mysqld/mysqld.pid
                      open_files_limit=8192

                      [mysqldump]
                      quick
                      max_allowed_packet=160M

                      [mysql]
                      no-auto-rehash
                      # Remove the next comment character if you are not familiar with SQL
                      #safe-updates

                      [isamchk]
                      key_buffer=64M
                      sort_buffer=64M
                      read_buffer=16M
                      write_buffer=16M

                      [myisamchk]
                      key_buffer=64M
                      sort_buffer=64M
                      read_buffer=16M
                      write_buffer=16M

                      [mysqlhotcopy]
                      interactive-timeout

                      #[client]
                      #socket=/var/lib/mysql/mysql.sock

                      Originally posted by Steve Machol View Post
                      Also a max_execution_time of 40 may not be sufficient for a 1MB file. I recommend at least 240.

                      Comment


                      • #12
                        Attachements are stored in the Database. When I get the error I get this as part of the text in the error window:

                        MySQL Error : Got a packet bigger than 'max_allowed_packet' bytes
                        Error Number : 1153



                        Originally posted by Kerry-Anne View Post
                        AdminCP > Attachments > Attachment Storage Type.

                        Without the actual error being received it is impossible to diagnose further and so we will need to know the actual error being received.

                        Comment


                        • #13
                          In addition to the vB settings, the allowed size of the attachments depends on the PHP and MySQL configuration. You may need to check and change the upload size for both PHP and for MySQL. Note, you'll need to have root access to the server to do this (or have your host do it.) Make these changes to php.ini:

                          upload_max_filesize = xM

                          ..and my.cnf (or my.ini for Windows systems)

                          set-variable=max_allowed_packet=xM

                          Change it to the size ('x') you want in Megabytes. Restart the webserver and MySQL after making these changes.

                          Note: You may also need to increase the max_execution_time and max_input_time variables in php.ini.

                          Also you might want to take a look at this for other settings that affect file uploads:

                          http://www.vbulletin.com/forum/showp...0&postcount=12
                          http://www.vbulletin.com/forum/showt...319#post748319
                          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                          Change CKEditor Colors to Match Style (for 4.1.4 and above)

                          Steve Machol Photography


                          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                          Comment


                          • #14
                            My host just changed the max_execution_time to 300. Would we still have issues if we were storing the files differently...not to the database?

                            Originally posted by Steve Machol View Post
                            Also a max_execution_time of 40 may not be sufficient for a 1MB file. I recommend at least 240.

                            Comment


                            • #15
                              That is only one of the server settings that could affect this. Storage type shouldn't matter.
                              Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                              Change CKEditor Colors to Match Style (for 4.1.4 and above)

                              Steve Machol Photography


                              Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X