1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Resolved Unable to upload large files via HTTP/HTTPS

Discussion in 'Plesk Onyx for Linux' started by AB M, Dec 4, 2017.

  1. AB M

    AB M New Pleskian

    3
    70%
    Joined:
    Feb 15, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Canada
    Hi all,
    I've spent the past 3 days of my life with this issue, hope you guys can help me.
    When posting fields with very long text (1MB) or uploading files larger than 1MB, it fails, and shows a 500 error on the Developer Console.
    Grabbed all error logs in the system but nothing is mentioned anywhere.
    PHP settings were set for way higher than 1MB in all system configuration files, and Plesk interface.

    Googled and tried all the fixes including this one: Unable to upload large files via PHP: HTTP request length exceeds MaxRequestLen
    but no luck :(

    fcgi is set to:
    memory_limit 128M for both local and master values
    post_max_size 200M 180M
    upload_max_filesize 200M 160M

    Additinal Apache directives
    <IfModule mod_fcgid.c>
    MaxRequestLen 1073741824
    FcgidMaxRequestLen 1073741824
    FcgidMaxRequestsPerProcess 1000
    FcgidProcessLifeTime 7200
    </IfModule>

    What am I missing?
    Please help !

     
  2. Peter Debik

    Peter Debik Golden Pleskian Plesk Guru

    37
    80%
    Joined:
    Oct 15, 2015
    Messages:
    1,981
    Likes Received:
    403
    Location:
    Berlin, Germany
    If it is a webserver upload, this could maybe be caused by the body size limit of Nginx. You can try to expand the body size limit to 1 GB for example.

    Add into httpd { } section of /etc/nginx/nginx.conf:
    Code:
    client_max_body_size 1G;
    
    Add to /usr/local/psa/admin/conf/panel.ini:
    Code:
    [webserver]
    
    nginxClientMaxBodySize =
    
    Including the empty line between the bracket header and the entry. It is correct and desired, that the equal sign is not followed by any value. This keeps Plesk from adding a default client_max_body_size directive to Nginx files and enables user-individual Nginx directives for it.

    After the changes:
    # service nginx reload

    Maybe the individual domain needs a reconfiguration, too:
    Apply any change to the domain configuration through GUI for it, so that the web server configuration files of the virtual host are re-created and the client_max_body_size is omitted in the Nginx virtual host configuration files.
     
  3. AB M

    AB M New Pleskian

    3
    70%
    Joined:
    Feb 15, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Canada
  4. Peter Debik

    Peter Debik Golden Pleskian Plesk Guru

    37
    80%
    Joined:
    Oct 15, 2015
    Messages:
    1,981
    Likes Received:
    403
    Location:
    Berlin, Germany
    If possible, could you please explain in more detail how filesize upload limit is linked to MySQL or where in the documentation that you provided this issue is described? This would be very helpful for future reference.
     
  5. AB M

    AB M New Pleskian

    3
    70%
    Joined:
    Feb 15, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Canada
    Best Answer
    In my case, the issue had nothing to do with PHP or Apache.
    And since the upload / post parameters are controlled from the code and php/apache configurations I thought, -as it might happen to many - that the problem was there.
    But it was not.
    If your settings are correct and you are using an old version of MySQL, make sure you upgrade it to at least 5.7.20 to avoid the bug that will prevent you from posting very long text to the database.
    Cheers!
     
Loading...