Page expire

Discussion in 'PHP' started by gigamike, Dec 8, 2006.

  1. #1
    Hi Guys,

    please help me. i try to upload a 60mb file via my script. I can upload smaller files but big files like 60mb, the page expire. I already set the ff in php.ini.

    memory_limit=200M
    upload_max_filesize=200M
    post_max_size=400M
    max_execution_time=3600

    Thanks,

    Mike
     
    gigamike, Dec 8, 2006 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It could be your host? For example dreamhost sets a limit of 7mb, regardless of php.ini settings. On dreamhost you can get round this by compiling your own php executable. On other hosts you might be able to ask them to increase the limit.
     
    matthewrobertbell, Dec 8, 2006 IP
  3. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    hi,

    thanks for the response. what do you mean host. Im in control of the server. By the way im using windows 2003 server and install php and apache there.

    Thanks again,

    mike


     
    gigamike, Dec 8, 2006 IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    inside the form there's a hidden value for the maximum size of the file change that value and you should be okay
     
    krakjoe, Dec 8, 2006 IP
  5. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    hi,

    thanks for the response. What form ?, i think not in the script. But i youre saying the php.ini, yes i already setup this

    memory_limit=200M
    upload_max_filesize=200M
    post_max_size=400M
    max_execution_time=3600

    and restart the apache.

    Still the page expire when uploading 6mb of file


     
    gigamike, Dec 8, 2006 IP
  6. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    In the html form you are using to upload the data to the php script, is ther a MAX_FILE_SIZE=(number)? if so you may need to bump it up to the right size
     
    matthewrobertbell, Dec 8, 2006 IP
  7. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    Hi,

    Thanks, ok i saw it, it has a value of

    <input name="MAX_FILE_SIZE" value="104857600" type="hidden">

    and i guess that is enough for 100mb. im just uploading 60mb

     
    gigamike, Dec 8, 2006 IP
  8. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #8
    What php code are you running? Have you checked if it has issues when on windows? As it is slightly different to *nix.
     
    matthewrobertbell, Dec 8, 2006 IP
  9. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #9
    yeah, my code is very simple

    on upload page
    <form method="post" enctype="multipart/form-data" action="vid_upload_2_save.php" name="theForm" id="theForm" onsubmit="return formValidator();">
    <input name="field_uploadfile" size="30" type="file">
    <input name="MAX_FILE_SIZE" value="104857600" type="hidden">
    </form>


    and upon saving, via $_POST["field_uploadfile"] then
    copy($_FILES['field_uploadfile']['tmp_name'], $add);


    Not sure about the windows but i think on windows :(. I cant figure it out.

     
    gigamike, Dec 8, 2006 IP
  10. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #10
    Likely to be your host then.....
     
    krakjoe, Dec 8, 2006 IP
  11. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Try http://www.tizag.com/phpT/fileupload.php tutorial instead and see if that works?
     
    matthewrobertbell, Dec 8, 2006 IP
  12. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #12
    Hi,

    sad to say, im the host. I have full access using administartor(root in linux) in the server.

    install php, apache and mysql. set php.ini

    memory_limit=200M
    upload_max_filesize=200M
    post_max_size=400M
    max_execution_time=3600



     
    gigamike, Dec 8, 2006 IP
  13. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #13
    If it works for one it should work for all, so it's likely your host have a max filesize set, or that tey simply do not allow users to edit ini settings in php.....
     
    krakjoe, Dec 8, 2006 IP
  14. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Krakjoe.....he has control, it's his own server!
     
    matthewrobertbell, Dec 8, 2006 IP
  15. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #15
    yes sir, correct. I git full access to the server and canplay araound it as an admin.

     
    gigamike, Dec 8, 2006 IP
  16. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #16
    lol, oh yeah, try set_time_limit(0); at the top of script
     
    krakjoe, Dec 8, 2006 IP
  17. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #17
    Hi,

    ok i will do, thanks

     
    gigamike, Dec 8, 2006 IP
  18. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #18
    :( no luck, still expire. What ive notice when i upload the 60mb file, it takes 2-3 mins. before it expire.


     
    gigamike, Dec 8, 2006 IP
  19. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #19
    If the server is running on a LAN or the same machine as you, it should only take a few seconds to transfer 60mb. Is there something fundamentally wrong with your server?
     
    matthewrobertbell, Dec 8, 2006 IP
  20. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #20
    :( yeah i try via Remote desktop in uploading and still page expire... any idea

     
    gigamike, Dec 8, 2006 IP