2

Somebody out there please tell me why I'm uploading a 17 MB file and PHP isn't showing a $_FILES array? It's just not there. I've set the max post limit and the max upload limit to 128 MB. The files are going to get way bigger than this. Why does this server like hurting me?

Comments
  • 1
    Just to be clear this is a legitimate cry for help I'm losing my mind.
  • 0
    Have you also set memory_limit? Also make sure to restart web services..
  • 0
    I have set memory_limit. And I restarted the whole machine, so desperate I was.
  • 0
    Can you double check you've set it for proper php version you're using / in correct config and confirm those settings with phpinfo()?
  • 0
    I've only got one version installed - I'll triple check that, but I've only got the php.ini in /etc/php/7.2
  • 1
    Is the upload finishing?
    Is the file in /tmp?
  • 0
    It's never defining $_FILES - my guess is that it never makes it as far as /tmp
  • 0
    :3 silly shameless confession time.

    I usually forget to mention enctype in my form tag.
  • 0
    I did that at first too to be honest - I checked that, and it works like a dream for small files under 2 MB.
  • 0
    Have you set the max post size in your web server? or are you using the inbuilt PHP server?
  • 0
    I'm using Apache, and yeah I've got that set as well. It's bizarre - I've set every variable that should be relevant and it doesn't seem to make a difference.
  • 0
    Maybe try using a different folder for the upload directory?
  • 0
    I know it’s obvious but did you check these...
    upload_max_filesize and post_max_size directives in your php.ini file.
  • 0
    Or try adding this to a .htaccess file in web root.

    php_value upload_max_filesize 40M
    php_value post_max_size 42M
  • 0
    Script time limit maybe?
  • 1
    Is you’re using Apache, does the Apache user (Apache/www-data, depending on OS) have write access to the directory?
  • 1
    Maybe you forgot the enctype (multipart/form-data) in your form submit 😉
  • 2
    This is the kinda bug where if u quickly do the exact same stuff in a fresh project it’ll work but not in the original 🙄
  • 0
    @helloworld I'll check those. I say them in php.ini but not in an .htaccess.
  • 0
    @Quirinus I've got that one at like 300.
  • 0
    @jelleken Exactly. It's exactly that kind of bullshit. 😂
  • 0
    Did you figured it out? You can contact me on discord tonight and can give you a hand if you haven't..
  • 1
    I recall that files are ignored with DELETE and PUT requests and only work through POST :/
Add Comment