Recently, I am working on a project based on the lamp system. During the system test phase, I found that Apache + PhP could not successfully upload large files. After Baidu and Google searched, the reason for the PHP configuration is found. Here, I will record a text article for reference in the future to avoid useless secondary retrieval.
First, configure the following parameters in PHP. ini based on the maximum file size (such as 32 m) that can be uploaded:
File_uploads = on; whether to allow HTTP File Uploads
Upload_max_filesize = 32 m; maximum allowed size for uploaded files
Post_max_size = 32 m; maximum size of post data that PHP will accept
The actual meaning of each parameter is obvious. Refer to the instructions in PHP. ini above.
In addition, considering the impact of network transmission speed, you may need to set the following parameters:
max_execution_time = 30000; maximum execution time of each script, in seconds
max_input_time = 600; maximum amount of time each script may spend parsing request data
memory_limit = 1024 m; maximum amount of memory a script may consume