Strange PHP file upload problem

Hello,
i have a form on a 3 years old website which consists of 30 file fields and a submit button. Sometimes i use all the fields to upload 30 images or only one (e.g field no 15) to upload one image etc.

This form works for 3 years on the same server with PHP5. A few days ago no files from field 21-30 are uploaded. If i put a single file on field 1 it gets uploaded, if the same file is put on field 25 nothing happens.

I run

print_r($FILE)

and only the first 20 field file variables are passed.

My php.ini configuration is :

memory limit 128M
max_execution_time 3000
max_input_time 60

Is there any value in the php configuration or something else that might have caused the $FILE variable to have a limited size?

The error log should help you to find out the cause of the problem.

unfortunally there is no error log, any other idea :frowning:

Not even the apache error log?

Failing that, I would want to find out what changed on the server?

that’s weird that it stops exactly at 20. I would do a find in my phpini for the number ‘20’. Dunno if you will uncover anything but this method helped me find a timeout problem on a site when it was timing out exactly at 6 seconds. Did a search for ‘6’ bam, there was the setting I needed to change.

I suspect that the server itself is not at fault.

If i put a single file on field 1 it gets uploaded, if the same file is put on field 25 nothing happens

Is the PHP code retrieving all of the fields?

Thanks for pointing me to the apache log file. There was the error “PHP Warning maximum number of allowable file uploads has been exceeded in Unknown on line 0”

which i found out is a new directive max_file_uploads in php.ini since php 5.3.1. Guess what the default value is … :slight_smile: yes 20 files. So i added max_file_uploads=30 to php.ini and everything is working.

Thanks

Well done, and thanks rustybuddy for the advice to search the config file for the magic number.