PHP: set max_file_uploads for one file, not php.ini

Like many variables in PHP using ini_set () on the page, it actually doesn't work.

I recently updated my version of PHP and found that my multiple image downloader is now limited. After 3 hours of frustration, I found that my new PHP installation has a new parameter "max_file_uploads" set to "20".

Thus, only the first 7 images are loaded (each of three sizes, 7 * 3 = 21).

Now I can change the value of mypp.ini "max_file_uploads" to 300, but I would prefer not to do this side as a whole.

Is there a way to set this value for only one file (upload.php)? Can I use a .htaccess file for this?

+4
source share
2 answers

Bugfix: max_file_uploads CANNOT be changed outside of php.ini. See PHP Error # 50684

+11
source

Yes, it can be changed. Use the .htaccess file and add the following:

php_value max_file_uploads 40 

For example, I use this in my .htaccess in the folder:

 php_value upload_max_filesize 25M php_value post_max_size 25M php_value max_file_uploads 1000 

;)

damian rossi

+5
source

Source: https://habr.com/ru/post/1304761/


All Articles