Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:troubleshooting:upload-large-file [2020/08/22 16:12]
qtwrk created
litespeed_wiki:troubleshooting:upload-large-file [2020/08/22 16:29]
qtwrk
Line 11: Line 11:
 2. **post_max_size** 2. **post_max_size**
  
-3. **max_execution_time** ​ (some PHP script may need to do some afterward process, like resizing or watermarking, ​somax_execution_time ​could also affect it)+3. **max_execution_time** ​ (some PHP script may need to do some afterward process, like resizing or watermarking, ​so max_execution_time ​could also affect it)
  
 4. **memory_limit** 4. **memory_limit**
  
-5. **upload_tmp_dir** (by default this would be **/tmp** , maybe system comes with default as 2GB in size , which if you upload a file bigger than 2GB, then it will undoubtedly fail because not enough disk space to save temporary file.)+5. **upload_tmp_dir** (by default this would be **/tmp** , many system comes with default as 2GB in size , which if you upload a file bigger than 2GB, then it will undoubtedly fail because not enough disk space to save temporary file.) 
 + 
 +If your **/tmp** is too small and can not resize it , you can choose to change the location, e.g. to ''/​var/​tmp''​ 
 + 
 +This setting can not be override by .htaccess , it must be set in php.ini. 
 + 
 +and make sure the new directory has permission to allow PHP user to read/write files, if you have **open_basedir** in action ,  
 +new path must be included as well. 
  
 ===== On LiteSpeed WebServer part, you may need to check:===== ===== On LiteSpeed WebServer part, you may need to check:=====
  
-1. **Swapping Directory** in **Server Configuration** > **General** (some reason for PHP's **upload_tmp_dir** )+1. **Swapping Directory** in **Server Configuration** > **General** (same reason for PHP's **upload_tmp_dir** ) 
 + 
 +You can change it to somewhere like ''/​var/​tmp/​lshttpd/​swap''​ , default ownership and permission as follow, you should make it same. 
 + 
 +<​code>​ 
 +[root@test ~]# ls -l /​tmp/​lshttpd/​ | grep swap 
 +drwxr-x--x 22 nobody nobody 4096 Aug 22 17:35 swap 
 +</​code>​
  
 2. **Max Request Body Size (bytes)** in **Server Configuration** > **Tuning** 2. **Max Request Body Size (bytes)** in **Server Configuration** > **Tuning**
Line 25: Line 40:
 3. **External App Timeout** , please check this [[litespeed_wiki:​php:​run-without-timeouts|page]] for further detail. 3. **External App Timeout** , please check this [[litespeed_wiki:​php:​run-without-timeouts|page]] for further detail.
  
-4. **Memory Soft Limit (bytes)** and **Memory Hard Limit (bytes)** in **External App** , if you don't see any PHP shows up in **External App** then please go to **PHP** tab instead, raise from default ​``2047M`` to a higher number , you can blindly raise it to something like `20470Mfor test purpose.+4. **Memory Soft Limit (bytes)** and **Memory Hard Limit (bytes)** in **External App** , if you don't see any PHP shows up in **External App** then please go to **PHP** tab instead, raise from default ​''​2047M'' ​to a higher number , you can blindly raise it to something like ''​20470M'' ​for test purpose.
  
 5. **wait-req-full-body** , please check this [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​envirnment_variables#​wait-req-full-body|page]] for further detail. 5. **wait-req-full-body** , please check this [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​envirnment_variables#​wait-req-full-body|page]] for further detail.
  
-===== Test ===== +===== Check and Test ===== 
  
 Here is a simple PHP upload script , you can use it to test the upload with large files. Here is a simple PHP upload script , you can use it to test the upload with large files.
  • Admin
  • Last modified: 2020/08/24 18:48
  • by Lisa Clarke