zoukankan      html  css  js  c++  java
  • To set Nginx Upload Size For “413–Request Entity Too Large” Error

    Modify NGINX Configuration File

    sudo nano /etc/nginx/nginx.conf
    

    Search for this variable: client_max_body_size. If you find it, just increase its size to 100M, for example. If it doesn’t exist, then you can add it inside and at the end of http

    client_max_body_size 100M;
    

    Restart nginx to apply the changes.

    sudo service nginx restart
    

    Modify PHP.ini File for Upload Limits

    It’s not needed on all configurations, but you may also have to modify the PHP upload settings as well to ensure that nothing is going out of limit by php configurations.

    If you are using PHP5-FPM use following command,

    sudo nano /etc/php5/fpm/php.ini
    

    If you are using PHP7.0-FPM use following command,

    sudo nano /etc/php/7.0/fpm/php.ini
    

    Now find following directives one by one

    upload_max_filesize
    post_max_size
    

    and increase its limit to 100M, by default they are 8M and 2M.

    upload_max_filesize = 100M
    post_max_size = 100M
    

    Finally save it and restart PHP.

    PHP5-FPM users use this,

    sudo service php5-fpm restart
    

    PHP7.0-FPM users use this,

    sudo service php7.0-fpm restart
    

    It will work fine !!!

  • 相关阅读:
    [USACO11DEC]牧草种植Grass Planting
    [LNOI2014]LCA
    PTA的Python练习题(九)
    竞争条件攻击
    burpsuite使用--暴力破解
    PTA的Python练习题(八)
    PTA的Python练习题(七)
    PTA的Python练习题(六)
    攻防世界Web进阶-Upload1
    BugkuCTF解题Web基础(一)
  • 原文地址:https://www.cnblogs.com/mouseleo/p/9521645.html
Copyright © 2011-2022 走看看