Home  >  Article  >  Backend Development  >  php cannot upload larger than 100

php cannot upload larger than 100

王林
王林Original
2019-09-29 17:46:142987browse

php cannot upload larger than 100

Solution to the problem that PHP cannot upload large files

1. Open the php.ini file

2. Find the post_max_size option

The maximum value for form submission. This item does not limit the size of a single uploaded file, but limits the submission data of the entire form. The default is 8m. Set For the value you need, it is recommended to set this parameter larger than upload_max_filesize.

3. Find the switch for file uploads

to allow uploading files via http and confirm that file_uploads = on.

4. Find upload_tmp_dir

and upload the file to the place where temporary files are stored on the server. If not specified, the system default temporary folder will be used; if the system reports an error message If there is "xxx temporary directory xxx", you need to set a valid directory for this directory. If no error is reported, don't worry about it.

5. Find upload_max_filesize

The maximum allowed upload file size, the default is 2m, set it to the value you need. This parameter is not recommended to exceed the post_max_size value, because it Controlled by the post_max_size value (even if upload_max_filesize is set to 1g and post_max_size is only set to 2m, files larger than 2m will still not be uploaded because it is controlled by the post_max_size value).

6. If you want to upload a file larger than 8m, you also need to set the following parameters:

1. Find max_execution_time = 600; run each php page The maximum time value (seconds), the default is 30 seconds;

2, max_input_time = 600; The maximum time required for each php page to receive data, the default is 60 seconds;

3, memory_limit = 8m; The maximum memory required for each php page, the default is 8m;

Recommended tutorial: PHP video tutorial

The above is the detailed content of php cannot upload larger than 100. For more information, please follow other related articles on the PHP Chinese website!

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