Home >Backend Development >PHP Tutorial >Specific solutions to limit upload file size in PHP_PHP Tutorial
In specific practice, we will find that setting the file upload size in php.ini is very troublesome and error-prone. Well, today we will teach you several specific solutions:
PHP limits the size of uploaded files No. 1:
In php.ini Check the following lines:
upload_max_filesize = 8M
post_max_size = 10M
memory_limit = 20M
Change these values to what I said and see if there is any problem. Also confirm the upload< ;form> There is no line similar to the following
This is also used to limit the upload size.
PHP limits the size of uploaded files second:
If it is apache 2, it needs to be modified
/etc/httpd/conf.d/php.conf
Change LimitRequestBody 524288 in 524288 (=512×1024) to a larger size, such as 5M (=5×1024×1024)
After PHP limits the upload file size, the above problems will not occur when uploading files. In response, the page cannot be uploaded and will be resolved!