Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,068
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Uploading Larger Files locking up script

    Ugh!!!!!

    I thought I had my "upload.php" script all done, but when I changed the Max File Size in my script from 150KB to 2MB it is locking up?!

    By this, I mean that when I click "Upload Photo", all I get is a white screen.

    I thought that might be occurring because it takes a while to upload a 2MB Photo, but then when I tried uploading a 291KB Photo I got the same issue?!

    Not to be difficult, but this script is sorta my "baby", and I'm not really crazy about posting all of my code here. Hope people can respect that.)

    I checked my php.ini file and see this...
    Code:
    post_max_size = 500M
    upload_max_filesize = 500M

    Any ideas what might be causing this issue?

    Thanks,


    Debbie

  • #2
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    what's your memory_limit? it should be bigger than post_max_size

  • #3
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    oh and max_execution_time and max_input_time must be enough to recieve data and process them

  • #4
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,068
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by patryk View Post
    what's your memory_limit?
    Code:
    ;;;;;;;;;;;;;;;;;;;
    ; Resource Limits ;
    ;;;;;;;;;;;;;;;;;;;
    
    max_execution_time = 30     ; Maximum execution time of each script, in seconds
    max_input_time = 60	; Maximum amount of time each script may spend parsing request data
    ;memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)
    ;2013-03-23
    memory_limit = 500M      ; Maximum amount of memory a script may consume (500MB)

    By increasing memory_limit to 500MB, it appears that I can upload up to a 2.9MB file so far.


    Quote Originally Posted by patryk View Post
    it should be bigger than post_max_size
    Um, not from what I am reading online.

    In fact, this topic seems to be fairly debated from what I am seeing so far!


    Logically, post_max_size should be larger than upload_max_filesize.

    Think about it...

    If upload_max_filesize = 2MB and post_max_size = 20MB, then you could upload 10 Photos that are 2MB each.

    But back to my apparent issue, the question seems to be...

    "How does memory_limit relate to the size of the File you are uploading?"


    If I am trying to upload a 2.9MB Photo, then does memory_limit have to be at least 2.9MB?


    If I am trying to upload 3 Photos which are 2MB each, then does memory_limit have to be at least 6MB?


    And more so, what happens if there are 5 Users who are simultaneously trying to upload 3 Photos that are each 2MB? Does memory_limit have to be 30MB or more?!




    Debbie

  • #5
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,068
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by patryk View Post
    oh and max_execution_time and max_input_time must be enough to recieve data and process them
    In my previous post, you can see what those are as well.

    I have no idea of what are *reasonable* values for any of these constants?!


    Debbie

  • #6
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    check this out: http://idealextensions.com/index.php...ing&Itemid=225
    it's all explained there.
    if this won't help, post all contents of php.ini


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •