The file upload size limit is usually set pretty low by shared hosting providers. Why? To save bandwidth, keep the server moving quickly, and think about it -- how many customers really need a large upload limit? If you do need to increase the maximum upload limit, all you need to do is place the following code snippet in your php.ini file:
共享主机提供商通常将文件上传大小限制设置得非常低。 为什么? 为了节省带宽,请保持服务器快速运行,然后再考虑-多少客户真正需要较大的上传限制? 如果确实需要增加最大上传限制,则只需将以下代码段放入php.ini文件中:
file_uploads = On
upload_max_filesize = 10M //needs to be in {x}M format
Note that not all hosting providers allow customers to increase the file upload limit. Take that into consideration when purchasing your customer's web hosting.
请注意,并非所有托管服务提供商都允许客户提高文件上传限制。 购买客户的虚拟主机时要考虑到这一点。
翻译自: https://davidwalsh.name/increase-php-file-upload-limit-using-php-ini