·
Added a discussion

Hi, any one having issues with uploading multiple pictures? .. I create the Album ( fine ) i select images 10+ ( 10 or under work fine! ) then press add, it briefely appears to upload them, then just goes grey and fails!.. I have already checked all limits, in studio.. albums, una files, and php.ini and php settings in server.. nothing works you cant upload more than 10 at a time..

  • 124
  • 1
Comments
    • Hello @atcbook!

      Could you please provide us the screenshots from your UNA studio->Dashboard->Server audit area and the summary size of your uploading images?

      • PHP:

        • version = 8.4.14 - UNDEFINED (value checking failed)
        • allow_url_fopen = On - OK
        • allow_url_include = Off - OK
        • magic_quotes_gpc = Off - OK
        • memory_limit = 564 MB - OK
        • post_max_size = 512 MB - OK
        • upload_max_filesize = 512 MB - OK
        • register_globals = Off - OK
        • safe_mode = Off - OK
        • disable_functions = opcache_get_status - OK
        • php module: curl = curl - OK
        • php module: gd = gd - OK
        • php module: mbstring = mbstring - OK
        • php module: json = json - OK
        • php module: fileinfo = fileinfo - OK
        • php module: zip = zip - OK
        • php module: openssl = openssl - OK
        • php module: exif = exif - OK

        MySQL:

        • version = 10.5.29 - OK

        Web-server: nginx/1.28.0

        • rewrite_module - UNDEFINED


        • Site optimization

          PHP:

          • PHP accelerator = ZendOPcache - OK
          • PHP setup = fpm-fcgi - OK

          MySQL:

          • key_buffer_size = 128 MB - OK
          • max_heap_table_size = 16 MB - OK
          • tmp_table_size = 16 MB - OK
          • thread_cache_size = 151 - OK
          • UNA:

            • DB cache = On (File based cache engine) - OK
            • Pages cache = On (File based cache engine) - OK
            • Page blocks cache = On (File based cache engine) - OK
            • Templates Cache = On (FileHtml based cache engine) - OK
            • CSS files cache = On - OK
            • JS files cache = On - OK
            • Compression for CSS/JS cache = On - OK
            • It’s very likely that the issue is related to your server’s available memory and the PHP/Nginx configuration limits. Processing time may vary depending on the operation and the number of available CPU cores, taking more or less time accordingly.

              Both have their own memory, upload size, and timeout restrictions, and when uploading large images or multiple files at once, these limits can easily be reached.

              ⚙️ PHP Configuration

              Open your php.ini file and increase the following values according to your server’s available resources:

              memory_limit = 4096M
              upload_max_filesize = 1024M
              post_max_size = 1024M
              max_execution_time = 300
              max_file_uploads = 100
              

              After making these changes, restart PHP-FPM:

              sudo systemctl restart php*-fpm
              

              🌐 Nginx Configuration

              In your Nginx site configuration file (usually /etc/nginx/sites-available/your-site.conf), increase both the upload limit and timeout values to handle large uploads:

              client_max_body_size 1024M;
              client_body_timeout 300s;
              send_timeout 300s;
              proxy_read_timeout 300s;
              proxy_connect_timeout 300s;
              proxy_send_timeout 300s;
              

              Then reload Nginx:

              sudo systemctl reload nginx
              

              These settings ensure that Nginx allows large files and doesn’t interrupt long uploads or slow connections.

              🧠 Checking Server Memory

              To make sure your server has enough free memory for these operations, you can check it directly from the command line:

              1. View total and available memory:

              free -h
              

              Example output:

                            total        used        free      shared  buff/cache   available
              Mem:           7.7G        2.1G        3.4G        200M        2.2G        5.1G
              Swap:          2.0G          0B        2.0G
              

              The “available” column shows how much memory can still be safely used.

              2. Monitor memory in real time:

              htop
              

              or

              top
              

              In htop, press M to sort processes by memory usage.

              3. Get a detailed overview (optional):

              sudo apt install glances
              glances
              

              This shows memory, CPU, swap, and network usage in real time.

              🧩 Additional Recommendations

              • Check if other applications or containers are consuming excessive RAM.
              • If possible, allocate more memory to your server or optimize running services.
              • Always keep PHP and Nginx limits balanced — for example, both using a 300-second timeout.
              • If physical memory is limited, consider enabling or increasing swap space as a buffer.

              💡 Tip:

              Before adjusting any configuration, always check how much available memory your server has using free -h.

              Try to allocate around 50–60% of the available memory to PHP, leaving the rest for the operating system and other services.

              Increasing PHP and Nginx limits often solves upload issues, but it’s equally important to ensure that your server has enough free RAM to support these settings.

              You can use my script to reinstall PHP, but it only supports versions up to 8.3: https://github.com/kabballa/PHP-UNA

              • thank you for your reply, however as i stated in the post above. I have changed all those values etc and it made no difference. it still wont upload more than 10. pictures at a time..

                • Well, your parameters look OK, so perhaps it might be some inner hosting limits. From my side, I could upload 11 images into album:

                  Before the submit:

                  and after:

                  • Is this a dedicated server or a VPS? What is the available memory and what processors does your server have?

                    • It is possible that your PHP is not configured correctly. Run my script and you will see that it works properly the installation completes in less than 1 minute. My script is designed to install PHP on the fly.

                      For handling more processes, you will need additional PHP child servers a standard setup is not enough for a large volume of files. You can check my configuration and see how the PHP child processes should be set up here:  https://github.com/kabballa/PHP-UNA/blob/dev/php.sh

                      ⚠️ If your server does not have enough resources, it is possible that it will not work properly.

                      PHP 8.3 works perfectly with this script. If you don’t want to reinstall, I plan to update it soon to support PHP 8.4, but I don’t have time to do that right now. You can also configure PHP 8.4 manually if you carefully follow the steps in my script.

                      if you change the php version you must also change the nginx config

                      aslo setup

                      # Maximum number of open files for PHP-FPM.

                      RLIMIT_FILES=65536

                      # Maximum size of core files created by PHP-FPM.

                      RLIMIT_CORE=0

                      These settings affect system-level limits, not just PHP-FPM, so you need to make sure your server allows them:

                      1. RLIMIT_FILES=65536 – sets the maximum number of files that PHP-FPM can open simultaneously.
                      • This limit can be restricted by Linux via ulimit or configuration files (/etc/security/limits.conf or /etc/systemd/system/php*.service.d/override.conf if using systemd).
                      • For systemd, you can add:
                      [Service]
                      LimitNOFILE=65536
                      
                      • Then run:
                      sudo systemctl daemon-reexec
                      sudo systemctl restart php8.3-fpm
                      
                      • (replace 8.3 with your PHP version)
                      1. RLIMIT_CORE=0 – limits the size of core dump files.
                      • 0 means core dumps are disabled.
                      • If you want to allow core dumps or set a different limit, you also need to adjust the system ulimit or other OS-level settings.

                      Changing only the www.conf file is not enough if the OS imposes stricter limits. You must ensure the system allows the values you set for PHP-FPM.

                      ⚠️ Make sure you restart the PHP-FPM and Nginx services after modifying any PHP or FPM configuration to apply changes properly.

                      • more nginx setup:

                        ###########################################################################
                        ## Client Timeout Settings
                        ###########################################################################
                        
                        client_max_body_size 4096M;
                        
                        # Timeout for receiving request body from the client
                        client_body_timeout 300;
                        
                        # Timeout for receiving request headers from the client
                        client_header_timeout 300;
                        
                        # Keep connection alive for reuse
                        keepalive_timeout 300;
                        
                        # Timeout for transmitting response to the client
                        send_timeout 300;
                        
                        # Reset lingering timed-out connections (helps prevent DDoS)
                        reset_timedout_connection on;
                        
                        ###########################################################################
                        ## Proxy Timeout Settings
                        ###########################################################################
                        
                        proxy_connect_timeout 300;
                        proxy_send_timeout 300;
                        proxy_read_timeout 300;
                        
                        ###########################################################################
                        ## PHP-FPM Settings
                        ###########################################################################
                        
                        location ~ \.php$ {
                          # Use PHP-FPM Unix socket instead of TCP port
                          fastcgi_pass unix:/run/php/php8.4-fpm.sock;
                          fastcgi_index index.php;
                          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                          include fastcgi_params;
                        
                          # Timeouts
                          fastcgi_connect_timeout 300;
                          fastcgi_send_timeout 300;
                          fastcgi_read_timeout 300;
                        
                          # Buffers
                          fastcgi_buffer_size 128k;
                          fastcgi_buffers 8 256k;
                          fastcgi_busy_buffers_size 512k;
                          fastcgi_temp_file_write_size 512k;
                        
                          # Improve performance for large uploads or scripts
                          fastcgi_request_buffering off;
                        }
                        
                        Login or Join to comment.