Large PHP Uploads Stall/Fail

Discussion in 'Install/Configuration' started by dlewis23, Mar 22, 2011.

  1. dlewis23

    dlewis23 Active Member

    I did a Force Reinstall of 4.1RC4 and while it did stay up longer, it still restarted. It had a uptime of about 1 hour 55 minutes before it did a restart this time. I'm trying to upload a large file and see if it breaks right now. I will update once its finished.
  2. dlewis23

    dlewis23 Active Member

    Just an update. I was able to upload a 850 MB file with no problem just now using 4.1RC4 and I think litespeed did restart close to the end of the upload.

    I'm going to try with a 1.5 GB file and see how it goes.

    Thank you for all your help so far.
  3. mistwang

    mistwang LiteSpeed Staff

    Can you give us details about your mod_rewrite rules. We will try to reproduce and fix the problem with 4.1RC5. 4.1 release will be based off 4.1RC5, need to address it before the official release.
  4. dlewis23

    dlewis23 Active Member

    I sent you a PM with my mod_rewrite rules. Not sure if you need anything else.

    Also I would like to add, that I can't upload any files larger then 1GB in size. When I select them and start the upload, the uploader just sits doing nothing. Any idea why this would happen?
  5. mistwang

    mistwang LiteSpeed Staff

    That's in document root .htaccess, right?
    Better sending us a the whole .htaccess file, if there is .htaccess in parent directory, send us that as well.
    It also may be related to mod_security rules if used. send us a copy of your mod_security rule.
    Last, we need the URL that should be rewritten but broken under 4.1RC5.
    If there is anything that may help replicating your problem in our lab, please also let us know.
    You can send those information to bug@litespeed...

    Right now, LiteSpeed has hard limit of 1GB for HTTP request body, we will bump it up to around 2GB.
  6. GOT

    GOT Well-Known Member

    I have checked the settings in this thread and others referenced. However, I am pretty new to Lightspeed and I'm not even sure I am looking in all the right places.

    I have a very basic upload script here:

    http://www.x x x

    The php code is simply:

    $target = "upload/";
    $target = $target . basename( $_FILES['uploaded']['name']) ;
    if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
    else {
    echo "Sorry, there was a problem uploading your file.";
    Very small files (a few K) upload fine. a 2 MB file (which should upload pretty quickly) causes the page to hang for a few minutes and then says something about the connection being terminated.

    I would really appreciate someone pointing me very specifically where I should look on this.
    Last edited by a moderator: Apr 28, 2011
  7. NiteWave

    NiteWave Administrator

  8. GOT

    GOT Well-Known Member

    We can't compile 5.3.x as it breaks our site and we are live on it now.

    phpinfo page is here

    http://www.x x

    upload_max is set to 550 MB. I'm pretty sure the php.ini is all set right for this. I'm assuming its a lightspeed setting(s) that I am missing.
    Last edited by a moderator: Apr 28, 2011
  9. NiteWave

    NiteWave Administrator

    php settings looks ok.

    1.Server –>Tuning–>Max Request Body Size (bytes) ?

    2.check permission of upload/:
    try and see:
    chmod 777 upload/
  10. peterpiper812

    peterpiper812 Member

    Yes it is chmod 777.

    Max Request Body Size (bytes) = 500M
  11. NiteWave

    NiteWave Administrator

    is mod_security installed? maybe some mod_security rules blocks upload/

    for test, change
    to something else, like "abc", see if any difference.

    If still problem, please PM the access info of the server.
  12. peterpiper812

    peterpiper812 Member

    It uploads small files so I know mod_security isn't blocking it.

    We have disabled the firewall and tested still no go.

    What exactly do you need access to?
  13. NiteWave

    NiteWave Administrator

    ssh root access
  14. NiteWave

    NiteWave Administrator

    tested, upload a 27M file and was successful.

    no control panel in this server, vhost is native lsws vhost.

    at first I noticed
    vhost: xxx->External App->$VH_NAME_lsphp has problem:
    Max Connections:5
    Environment:Not Set

    changed back to default server level lsphp5, then testing upload, no problem.
    the server has 24G memory. 'top -c' shows a lot of
    consumed CPU most.
    so I tuned default external app: lsphp5, change max connections from 35 to 100. i.e.,
    Max Connections:100 (from 35)
    PHP_LSAPI_MAX_REQUESTS=500 (no change)
    PHP_LSAPI_CHILDREN=100 (from 35)

    another important change:
    ...../>chown -R nobody:nobody cache
    this is because lsphp5 running as nobody, so cache folder should be owned by nobody as well.

    after above 3 changes, as far as I noticed, the website has become quite fast.

    here's the problem reported by user:
    "Once we hit 4000 online it starts to get very slow"

    Let's watch what's going on after above changes.

    the lsws version is 4.1
  15. eray2509

    eray2509 Member

    Uploads Problem Switch Litespeed

    I'm having a problem with PHP uploads and FTP server uploads. For some reason I can't upload files greater then about 20 MB.

    Litespeed Version - 4.1.12

    - body size limit is 1G

    - max_file_size etc. changing max value.

    - i have try to diffrent methods upload file -> swf upload, browser upload, ftp server upload. swf upload and browser upload not working, ftp server upload is working but every 20 sec restart connection

    Could not write to transfer socket: ECONNABORTED - Connection aborted
    226-Error during read from data connection
    226 Transfer aborted

    I switch apache server and everything working fine.

    Does anyone have any settings or ideas for me to try?

  16. NiteWave

    NiteWave Administrator

  17. eray2509

    eray2509 Member

    server php.ini files and those limits correct
  18. eray2509

    eray2509 Member

    php.ini limits
    upload_max_filesize 2000M
    file_uploads On
    upload_tmp_dir NULL
    max_file_uploads 20
    post_max_size 2000M
  19. NiteWave

    NiteWave Administrator

    these values looks ok. but lose this one:

    in Litespeed:
    Server–>Tuning–>Max Request Body Size (bytes)
  20. eray2509

    eray2509 Member

    Max Request Body Size 1GB

Share This Page