Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:troubleshooting:upload-large-file [2020/08/22 16:13] qtwrk [On LiteSpeed WebServer part, you may need to check:] |
litespeed_wiki:troubleshooting:upload-large-file [2020/08/22 16:27] 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 , make sure new path is included. | ||
===== 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** (same 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 29: | Line 43: | ||
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. |