search
Homephp教程php手册PHP限制上传文件大小的具体解决办法

PHP限制上传文件大小的具体解决办法

Jun 13, 2016 am 11:05 AM
phpphp.iniuploadspecificMethodexistbigpracticeusdocumentNowofsolveset uplimit

我们在具体的实践中会发现在php.ini中设置文件上传大小的时候会非常麻烦,而且还很容易出错。那么,今天我们就教大家几种具体的解决方法:

PHP限制上传文件大小第一

在php.ini里面查看如下行:

upload_max_filesize = 8M

post_max_size = 10M

memory_limit = 20M

把这些值改成我所说的,看看有没有问题,另外要确认上传的

里没有类似下面的这行

这样也是限制上传大小用的。

PHP限制上传文件大小第二:

如果是apache 2 需要修改

/etc/httpd/conf.d/php.conf

中的LimitRequestBody 524288将524288(=512×1024)改大,比如5M(=5×1024×1024)

在PHP限制上传文件大小之后,文件上传就不会出现如上问题,上传不响应,上传现实该页无法现实也将得到解决!


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)