Home  >  Article  >  Backend Development  >  Solution to the problem that the file uploaded by PHP is too large and $_FILES is empty

Solution to the problem that the file uploaded by PHP is too large and $_FILES is empty

WBOY
WBOYOriginal
2016-07-25 08:55:391354browse
This article introduces the solution to the problem that $_files is displayed as empty when the uploaded file is too large in PHP programming. Friends in need can refer to it.

Contents of this section: Solve the problem of $_FILES being empty when PHP uploads files that are too large.

In the program developed by PHP, when uploading pictures, I found that a gif picture failed to upload. The size was 0, and the actual size was 4.66M.

Share the solution to the problem that the file is too large when uploading files in PHP.

It works when uploading small files, but not when uploading large files. Check upload_max_filesize = 2M in PHP.INI. The problem often lies here.

Modify its value:

; Maximum allowed size for uploaded files. upload_max_filesize = 20M

Restarted the Nginx or apache server, and when uploading the php file again, I found that the problem was solved.



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