Home >Backend Development >PHP Tutorial >Modify PHP file upload size in windows/linux_PHP tutorial

Modify PHP file upload size in windows/linux_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:08:28670browse

In PHP, only 2MB files can be uploaded by default. If we want to upload more and larger files, we need to modify some parameters. Please refer to them below.

linux system

1./usr/local/nginx/conf/nginx.conf
Modify

client_max_body_size

2./usr/local/php/etc/php.ini

Modify

post_max_size
upload_max_filesize

3. Restart LNMP /root/lnmp restart

windows system

The default post_max_size of PHP is 2M. If the POST data size is greater than post_max_size $_POST and $_FILES superglobals will be empty.
Find

post_max_size .

changed to
post_max_size = 150M

Look for upload_max_filesize, the default is 8M and change it to

upload_max_filesize = 100M

Another thing to note is that post_max_size is better than upload_max_filesize.

Summary

In fact, it is to modify three parameters in php.ini

upload_max_filesize = 8M
post_max_size = 10M
memory_limit = 20M

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629835.htmlTechArticleIn php, only 2MB files can be uploaded by default. If we want to upload more and larger files, we need to modify it. Some parameters, please refer to them below. linux system 1./usr/local/nginx/...
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