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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post

    PHP issue. "stopping working"

    Hello guys i'm wrote a code that you upload images to a server and the PHP saves it and resizes it.

    The array of images has ilimited "weight" and i've already set the post-max-size and upload-max-size at php.ini to 9999m and set set_limit_time(0);

    but the result is that the code only render several files.

    what should i do?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Check your error logs for any errors generated.
    You also need to check for max_file_uploads as well. Needless to say, max sizes used to be capped at about 2GB, but I think its been increased. It of course must be < total server memory available, and preferably no more than 50% of available memory.

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post
    Im at localhost so that total server memory u mean my ram memory?

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by sorlaker View Post
    Im at localhost so that total server memory u mean my ram memory?
    That's correct. You cannot give it more than your system memory for max sizes (post and uploads). Which leads to one more simple question: why are you using 10GB for your max filesize? If you need to move this many files or files this large you would be better off using FTP and cron to do the resizes.
    Oh you'll probably need to increase the memory_limit as well. The default is 128M currently, which I believe is up from. . . 28 or was it 12?
    Also your webserver software will have limitations, both in sizes and time to consider. Apache I believe has maximum timeout of 300 seconds, and LimitRequestBody of up to 2GB (although I believe the default is infinite).
    Setting this so high requires a lot of changes in order to stick. I'd suggest you need at most 512MB. Even assuming that a larger bitmap (example: a google search pulled up a 1080p bitmap @ 5.9MB), you can still upload nearly 50 of them in that memory usage. I'd also suggest you move no more than 20 at a time.

  • #5
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post
    i've set the max_file_upload to 600 and it worked perfectly. i understand your point but what if the user can't/(doesn't want to install) use and ftp client?

    if the user wants to upload 100 files. Can i split it and work with 20 separately?

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Nothing says you cannot. You present a form with 20x uploads, then when complete you send them back to the form for the next 20.

  • Users who have thanked Fou-Lu for this post:

    sorlaker (12-29-2012)

  • #7
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,283
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    Quote Originally Posted by sorlaker View Post
    i understand your point but what if the user can't/(doesn't want to install) use and ftp client?
    Well then it's (sorry to say) tough luck! We can't solve that for you, thats between you and the host / users to work out another way of doing it.

    Quote Originally Posted by sorlaker View Post
    if the user wants to upload 100 files. Can i split it and work with 20 separately?
    Yes but you'll need to keep track of what files you've processed and what you haven't. That could be as simple as keeping them in different folders or recording them all in a database table.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • Users who have thanked tangoforce for this post:

    sorlaker (12-29-2012)


  •  

    Posting Permissions

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