Modify PHP upload file size limit

PHP upload files are generally limited by default.  
Sometimes we need to upload large files, so how to modify the size of the PHP upload limit?  

1. General PHP file upload, unless the file is small. Like a 5M file,  
   It is likely to take more than one minute to complete the upload. But in php, the default maximum execution time of the page is 30 seconds. That is to say, if it exceeds 30 seconds,
   the script will stop executing. This results in the situation that the webpage cannot be opened.  
   This We can modify max_execution_time and find  
    max_execution_time in php.ini. The default is 30 seconds. Change to max_execution_time = 600  
   0 means there is no limit  
    The above modification is the script execution timeout time in the php upload file.  

2. Modify post_max_size to set the maximum allowed POST data size.  
    This setting also affects php upload files.  
     The default post_max_size of php is 2M.  
      If the POST data size is larger than post_max_size $_POST and $_FILES superglobals will be empty.  
      Look for post_max_size. Change to post_max_size = 150M  

3. Many people will change the second step. But when php uploads files, the maximum is still It is 8M.  
    Why. We also need to change a parameter upload_max_filesize to indicate the maximum size of the uploaded file. 
     Find upload_max_filesize, the default is 8M and change to upload_max_filesize = 120M.  
    In addition, it should be noted that in php file upload, post_max_size is better than upload_max_filesize.  
     Friends who need to upload php files can refer to the above settings!  
After setting the above operations, you need to restart the WEB

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326780353&siteId=291194637