我的服务器不接受大于 2MB 的文件?



我已经检查了php.ini中的设置,一切都很好。还有什么我必须改变才能让它发挥作用的吗?

您需要在php.ini中设置upload_max_filesize和post_max_size的值:

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M
; Must be greater than or equal to upload_max_filesize
post_max_size = 10M

修改php.ini文件后,您需要重新启动HTTP服务器才能使用新的配置。

http://php.net/manual/en/ini.list.php
upload_max_filesize"2M"PHP_INI_PERDIR
http://php.net/manual/en/configuration.changes.modes.php
PHP_INI_PERDIR条目可以在PHP.INI、.htaccess、httpd.conf或.user.INI中设置(自PHP 5.3起)
因此,您不能对此使用ini_set。

最新更新