You need to pay attention to the php.ini file when uploading files
Before formally explaining the upload in this chapter, the first thing we need to pay attention to is the php.ini file.
This is our first introduction to how to modify the php.ini file. If your configuration items are inconsistent with what we said, please pay attention to the modification.
Let’s understand each configuration item.
Let’s take a look at how to modify php.ini.
There are too many php.ini files. If you can’t find them, you can use ctrl+f to search for related configuration items.
Configuration item | Function description |
---|---|
on is to turn on the file upload function, off is to turn it off | |
The maximum value of POST parameters allowed by the system | |
The maximum size of uploaded files allowed by the system | |
Memory usage limit |
Recommended size: file_size (file size) < upload_max_filesize < post_max_size < memory_limit
In addition, you need to pay attention to the script execution time. max_execution_time, the unit of this parameter is seconds.This parameter is to set the maximum execution time of the script.
You can also make appropriate changes according to your needs. Usually there is no need to modify it, the system default value is enough. When uploading very large files, this parameter may be modified.