Home > Backend Development > PHP Problem > How to modify the upload size configuration in php.ini

How to modify the upload size configuration in php.ini

王林
Release: 2023-03-12 11:58:01
Original
2490 people have browsed it

How to modify the upload size configuration in php.ini: 1. Enable HTTP upload file configuration and specify the temporary file storage location; 2. Modify the upload file size configuration and the maximum form reception value; 3. Restart the server.

How to modify the upload size configuration in php.ini

The operating environment of this article: windows10 system, php 7, thinkpad t480 computer.

Let us take a look at the specific steps to modify the upload file size configuration:

1. Open php.ini

1. file_uploads = on ;

Whether to allow file upload via HTTP switch, the default is ON;

2. upload_tmp_dir;

The file is uploaded to the place where temporary files are stored on the server. If it is not specified, it will Use the system's default temporary folder;

3.upload_max_filesize = 8m;

Wangwen business, that is, the maximum allowed file size for uploading, the default is 2M;

4 .post_max_size = 8m;

refers to the maximum value that can be received through POST to PHP through the form, including all values ​​​​in the form, the default is 8M;

Generally, set the above four After setting the parameters, uploading files of

2. Restart the php service to make the configuration take effect

service php-fpm restart
systemctl restart php-fpm
Copy after login

Recommended learning: php training

The above is the detailed content of How to modify the upload size configuration in php.ini. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template