Summary of php configuration parameters related to file uploads

  • 2020-06-15 07:50:28
  • OfStack

I made a picture upload, but it was not easy. Later, I found it was the configuration problem of php parameters.
The php parameters related to file upload are summarized below
All of these parameters are set in php.ini.

1.file_uploads
Set to On to allow files to be uploaded via HTTP

2.upload_tmp_dir
The directory used for temporary storage when files are uploaded to the server, if not specified, the default temporary folder is used (my machine is /tmp).

3.upload_max_filesize
The maximum allowed file size is 2M by default.

4.post_max_size
The maximum value of post data that Php can receive, including the sum of all values in the form, is 8M by default.

5.memory_limit
The maximum amount of memory per php, which is greater than the file size allowed for uploads.

6.max_execution_time
Maximum time per php run (seconds), default 30 seconds.

7.max_input_time
The maximum time (in seconds) for POST/GET data to be parsed, 60 seconds by default. This sets time seconds a scripts to parse data, like POST GET is the mement of the the the to of script execution.

Related articles: