Welcome to Centmin Mod Community
Become a Member

PHP-FPM How do I increase the file upload size?

Discussion in 'Centmin Mod Insights' started by Abbas Jaffar Ali, Aug 30, 2014.

  1. Abbas Jaffar Ali

    Abbas Jaffar Ali New Member

    13
    4
    3
    Jun 18, 2014
    Ratings:
    +4
    Local Time:
    1:05 PM
    I remember asking this before and getting an answer but can't seem to locate where I did that. Where and dow do I increase the file upload size for php?
     
  2. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    6:05 PM
    1.11
    10.2
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    30,953
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,416
    Local Time:
    8:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    For PHP, 2 values in php.ini are

    Code:
    php -i | egrep '^upload_max_filesize|post_max_size'
    
    post_max_size => 15M => 15M
    upload_max_filesize => 15M => 15M
    you can either edit php.ini which may reset on PHP upgrades, or create custom.ini file as outlined at PHP-FPM - Transfer all my custom changes from php.info to php-fpm config | Centmin Mod Community and place the custom values in custom.ini

    i.e. /etc/centminmod/php.d/custom.ini
    Code:
    post_max_size=20M
    upload_max_filesize=20M
    Then restart PHP-FPM

    For Nginx what @RoldanLT stated :)
     
    • Like Like x 1
  4. Abbas Jaffar Ali

    Abbas Jaffar Ali New Member

    13
    4
    3
    Jun 18, 2014
    Ratings:
    +4
    Local Time:
    1:05 PM
    Thank you both
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    5:05 AM
    latest
    10
    I have changed all 3 values to equal the same

    Code:
    post_max_size = 100M
    upload_max_filesize = 100M
    client_max_body_size = 100M

    and restarted nprestart and even rebooted the VPS and the values have still yet to change displayed in php.ini
    Any suggestions here?

    PHP 5.4.40 | Centmin Beta02
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,953
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,416
    Local Time:
    8:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    .08 beta has a new custom file at /etc/centminmod/php.d/a_customphp.ini and add the change to that to override php.ini :)
     
  7. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    5:05 AM
    latest
    10
    Thanks George!
     
  8. Andy

    Andy Active Member

    333
    48
    28
    Aug 6, 2014
    Ratings:
    +57
    Local Time:
    5:05 AM
    I tried to upload a 72MB video using XFMG and got this error
    client intended to send too large body: 72825747 bytes,

    I check my /etc/centminmod/php.d/a_customphp.ini and the content is
    Code:
    date.timezone = Australia/Brisbane
    max_execution_time = 60
    short_open_tag = On
    realpath_cache_size = 6144k
    realpath_cache_ttl = 86400
    upload_max_filesize = 800M
    client_max_body_size =800M
    memory_limit = 800M
    post_max_size = 800M
    expose_php = Off
    mail.add_x_header = Off
    max_input_nesting_level = 128
    max_input_vars = 10000
    mysqlnd.net_cmd_buffer_size = 16384
    always_populate_raw_post_data=-1
    I have no problem uploading video files of 40MB but with a large size allowed, any clue on why the 72mb file failed?
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,953
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,416
    Local Time:
    8:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    should be /usr/local/nginx/conf/nginx.conf setting
    Code:
    client_max_body_size 10m;
    for my forums i have 10mb max size
     
    • Like Like x 1
  10. Andy

    Andy Active Member

    333
    48
    28
    Aug 6, 2014
    Ratings:
    +57
    Local Time:
    5:05 AM
    Great. I had 50MB limit there. I thought the setting in custom.ini will overwrite it?
    Thanks George
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,953
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,416
    Local Time:
    8:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    that custom.ini is php setting, nginx.conf is nginx level - so different areas :)
     
    • Like Like x 1
  12. Andy

    Andy Active Member

    333
    48
    28
    Aug 6, 2014
    Ratings:
    +57
    Local Time:
    5:05 AM
    I must have misunderstood things. I see a few posts above suggesting making the changes about upload file size to the custom.ini and it uses the same client_max_body_size variable.
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,953
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,416
    Local Time:
    8:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    Now ya know :)
     
    • Like Like x 1