Join the community today
Register Now

Request Entity Too Large

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by adamus007p, Aug 13, 2019.

  1. adamus007p

    adamus007p Premium Member Premium Member

    61
    4
    8
    Feb 8, 2019
    Ratings:
    +5
    Local Time:
    5:18 PM
    Hello,

    I have a problem when I want to import a bigfile to clone wordpress I have error
    /wp-admin/admin-ajax.php?action=ai1wm_import 413 (Request Entity Too Large)

    the plugin is all in one migration plugin.

    In developers tools in console i see:

    Code:
    jquery.js?ver=1.12.4-wp:4 POST https://mydomain.com/wp-admin/admin-ajax.php?action=ai1wm_import 413 (Request Entity Too Large)
    send @ jquery.js?ver=1.12.4-wp:4
    ajax @ jquery.js?ver=1.12.4-wp:4
    FileUploader.upload @ import.min.js?v=7.4&ver=5.2.2:1369
    (anonymous) @ import.min.js?v=7.4&ver=5.2.2:1257
    dispatch @ jquery.js?ver=1.12.4-wp:3
    r.handle @ jquery.js?ver=1.12.4-wp:3
    import.min.js?v=7.4&ver=5.2.2:1395 Uncaught Error: error
        at Object.error (import.min.js?v=7.4&ver=5.2.2:1395)
        at i (jquery.js?ver=1.12.4-wp:2)
        at Object.fireWith [as rejectWith] (jquery.js?ver=1.12.4-wp:2)
        at x (jquery.js?ver=1.12.4-wp:4)
        at XMLHttpRequest.c (jquery.js?ver=1.12.4-wp:4)
    Any idea what is wrong and I should correct?


    From nginx

    Code:
    client_max_body_size 1024m;
    connection_pool_size  512;

    a_customphp.ini
    Code:
    date.timezone = UTC
    max_execution_time = 960
    short_open_tag = On
    realpath_cache_size = 4096k
    realpath_cache_ttl = 43200
    upload_max_filesize = 640M
    memory_limit = 640M
    post_max_size = 640M
    expose_php = Off
    mail.add_x_header = Off
    max_input_nesting_level = 128
    max_input_vars = 10000
    mysqlnd.net_cmd_buffer_size = 16384
    mysqlnd.collect_memory_statistics = Off
    mysqlnd.mempool_default_size = 16000
    always_populate_raw_post_data=-1
    

    the file for uplod domain.wpress is about 250MB size.
     
  2. skringjer

    skringjer Member

    78
    11
    8
    Apr 21, 2019
    Ratings:
    +14
    Local Time:
    8:18 PM
    In your nginx.conf increase client_max_body_size or if your files are too large you can disable it by client_max_body_size 0; and restart your nginx.
     
  3. eva2000

    eva2000 Administrator Staff Member

    41,088
    9,194
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,104
    Local Time:
    1:18 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    strange if your /usr/local/nginx/conf/nginx.conf already has
    Code (Text):
    client_max_body_size 1024m;
    

    and php has
    Code (Text):
    upload_max_filesize = 640M
    memory_limit = 640M
    post_max_size = 640M
    

    you shouldn't be getting 413 Request Entity Too Large errors. Unless wordpress is setting it's own php limits

    check in wordpress admin > tools > site health > info tab under wordpress contents to see if any of them are set
     
  4. adamus007p

    adamus007p Premium Member Premium Member

    61
    4
    8
    Feb 8, 2019
    Ratings:
    +5
    Local Time:
    5:18 PM
    I have spend 3hours and finally I have installed version of module from github and it works.
    It seems that the problem is with module.

    PS. I was checking to set up limits on WordPress side. Not helped.


    Only one thing is wp-admin/site-health.php:

    Code:
    PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.
    
    The WordPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook (opens in a new tab).
    
    Warning The optional module, fileinfo, is not installed, or has been disabled.

    Should it be as desired by centminmod or something is missing?



    and

    Background updates ensure that WordPress can auto-update if a security update is released for the version you are currently using.

    • Error A plugin has prevented updates by disabling wp_version_check().
     
  5. eva2000

    eva2000 Administrator Staff Member

    41,088
    9,194
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,104
    Local Time:
    1:18 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    How much memory on your server ?
    output for command
    Code (Text):
    free -m
    

    For 123.09beta01 and higher, you need at least 1023000 kilobytes of total swap space and 780000 kilobytes of memory to enable fileinfo php extension due to fileinfo's native high memory compilation requirements.

    Basically fileinfo php compile via source is memory intensive. Same problem whenever you source compile PHP on any system

    i.e.
    If you meet the swap disk and minimum memory requirements, set in persistent config file /etc/centminmod/custom_config.inc
    Code (Text):
    PHPFINFO=y
    

    then run centmin.sh menu option 5 to recompile your php version
     
  6. adamus007p

    adamus007p Premium Member Premium Member

    61
    4
    8
    Feb 8, 2019
    Ratings:
    +5
    Local Time:
    5:18 PM
    VPS is 8GB RAM. @eva2000 should I meet the requirements?

    Code:
    free -m
                  total        used        free      shared  buff/cache   available
    Mem:           7821         636        5553         192        1630        6682
    Swap:          8063           0        8063
    
     
    Last edited: Aug 14, 2019
  7. adamus007p

    adamus007p Premium Member Premium Member

    61
    4
    8
    Feb 8, 2019
    Ratings:
    +5
    Local Time:
    5:18 PM
    What is for this plugin -fileinfo?

    Should I enable it?
    Shout it be enable automatically as I meet the requirements?
     
  8. adamus007p

    adamus007p Premium Member Premium Member

    61
    4
    8
    Feb 8, 2019
    Ratings:
    +5
    Local Time:
    5:18 PM
  9. eva2000

    eva2000 Administrator Staff Member

    41,088
    9,194
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,104
    Local Time:
    1:18 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    PHP: Introduction - Manual

    so if you have memory resources like you have should be fine to enable it