Home > Article > Backend Development > How to solve the problem of php upload file error
Solution to php file upload error: 1. Set the value of "post_max_size" in the php.ini configuration file; 2. Modify the value of "upload_max_filesize" in php.ini.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
Common Errors in PHP File Upload
Today, during the file upload process, I encountered a problem that the file could not be uploaded, and an error was reported on the web page. Finally, after checking, I summarized the following aspects:
Upload file error code
error=0 正常上传 error=1 上传的大小超过了input[type=file]的文件上传框最大大小 error=4 没有上传任何文件
Two restrictions encountered in file upload
1.post restrictions
The maximum upload allowed by the form is about 3M. The value of post_max_size can be set in the php.ini configuration file.
If the upper limit is exceeded, the form refuses to carry data.
2.upload restrictions
Modify the value of upload_max_filesize in php.ini
[Recommended learning: "PHP Video Tutorial"]
The above is the detailed content of How to solve the problem of php upload file error. For more information, please follow other related articles on the PHP Chinese website!