PHP:为一个文件而不是php.ini设置max_file_uploads [英] PHP: Set max_file_uploads for one file rather than php.ini
问题描述
就像在页面上使用ini_set()的PHP中的许多变量实际上并不起作用.
Like many variables in PHP using ini_set() on a page doesn't actually work.
我最近升级了我的PHP版本,发现我的多图像上传器已被设置为上限.经过3个小时的挫败,我发现我的新PHP安装将新的"max_file_uploads"参数设置为"20".
I've recently upgraded my PHP version and found that my multiple image uploader is now capped. After 3 hours of frustration, I've found that my new PHP install has the new "max_file_uploads" parameter set to "20".
因此,只有前7张图片被上传(每张图片的大小均为3 * 7 * 3 = 21).
So only the first 7 images get uploaded (each is in three sizes, 7*3=21).
我现在可以将php.ini的"max_file_uploads"值更改为300,但我不想这样做.
I can now change my php.ini value of "max_file_uploads" to 300, but I'd rather not do that side wide.
有什么方法可以只为单个文件(upload.php)设置该值吗?可以使用.htaccess文件吗?
Is there any way to set that value just for a single file (upload.php)? Could a .htaccess file be used for this?
推荐答案
更正:不能在php.ini之外更改max_file_uploads.参见 PHP错误"#50684
Correction: max_file_uploads can NOT be changed outside php.ini. See PHP "Bug" #50684
这篇关于PHP:为一个文件而不是php.ini设置max_file_uploads的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!