php upload_max_filesize ignored - unable to upload 5gb file

5,913

This PHP-Change log

http://php.net/ChangeLog-5.php#5.6.0

states that, until PHP 5.6.0, file uploads were limited to 2 GB.

Share:
5,913

Related videos on Youtube

a coder
Author by

a coder

SOreadytohelp

Updated on September 18, 2022

Comments

  • a coder
    a coder over 1 year

    I'm unable to upload files larger than roughly 2gb. The max upload/post values were previously set to 2500MB so I thought that was the problem.

    First,

    # php --version
    PHP 5.3.3 (cli) 
    

    I set upload_max_filesize and post_max_size as follows

    # vi /etc/php.ini
    post_max_size = 5500M
    upload_max_filesize = 5500M
    [write/quit vi]
    

    Next,

    # service httpd restart
    Stopping httpd:                                            [  OK  ]
    Starting httpd:                                            [  OK  ]
    

    I then confirmed the new configuration with a phpinfo() script:

    post_max_size   5500M   5500M
    upload_max_filesize 5500M   5500M
    

    I go back to my script to upload another large data file (~4GB), and am again told that the uploaded file exceeds value of upload_max_filesize.

    So, I am at a loss. I am able to upload 2gb and smaller files no problem. I've restarted Apache, and don't know where to go from here.

    • Michael Hampton
      Michael Hampton over 9 years
      Exactly what operating system, distribution, etc.?
    • a coder
      a coder over 9 years
      CentOS 6.5, Apache 2.2
    • a coder
      a coder over 9 years
      It does and the file size limit matches what is in php.ini. The software (VIMP) is known to work just fine with very large files ( >5gb )
  • Zoredache
    Zoredache over 9 years
    Testing with php -i may still give him the wrong file. It isn't uncommon to have a completely different config for the CLI vs the Apache module, or CGI.
  • a coder
    a coder over 9 years
    I'm updating the correct file because if I change upload_max_filesize to 9999M, then restart apache, I see that reflected in phpinfo();
  • a coder
    a coder over 9 years
    64 bit CentOS with 24gb RAM. Wondering if I have a 32-bit version of Apache installed now. How would I find that out?
  • a coder
    a coder over 9 years
    $ file /usr/sbin/httpd /usr/sbin/httpd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
  • skarap
    skarap over 9 years
    is there an error message in error_log?
  • a coder
    a coder over 9 years
    ooo till Monday, can't get to my video production machine. will follow up then (and delete this message at that time)