Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: php parsing/reading large text files

  1. #1
    Join Date
    Jun 2011
    Location
    Pearl of the East
    Posts
    54
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default php parsing/reading large text files

    good day everyone ^_^

    please help me with my problem,.

    i am reading/parsing large text files,.

    i read on the internet that the default memory limit of php is 16M

    but why is it my program doesn't read my 8MB text file?,.

    only those text files whose lower than 8MB are readable,.

    can you enlighten me please?




    thx in advance
    more power to dynamic drive and to y'all
    GOD Bless always,.

    -regicide del feroz
    Last edited by regicidedelferoz; 07-05-2011 at 01:17 AM. Reason: resolved

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,082
    Thanks
    96
    Thanked 98 Times in 96 Posts

    Default

    What is your program? Browsers tend to read text files as text.
    To choose the lesser of two evils is still to choose evil. My personal site

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Are you getting it as POST data? POST has a default max size of 8mB.
    Corrections to my coding/thoughts welcome.

  4. #4
    Join Date
    Jun 2011
    Location
    Pearl of the East
    Posts
    54
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    @james438
    sir,. my program is a php program that reads text file and parse it then creates a new text file for the result,.

    my problem is, it can read and parse text files below 8mb but it can't read and parse 8mb above,.



    @bluewalrus
    yes sir im using POST data,. how to change its max size?,. or should i use GET data?,.




    thx for your replies guys,.
    thx for trying to help me,.


    More power to you,.
    GOD Bless always,.


    -regicide del feroz

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    POST data has no max size set by the browsers so I'd recommend using post and just upping your max post size. Do you have access to your server or the php.ini file? If so find the max post size and up it. PHP.net says "memory_limit should be larger than post_max_size" so you may want to up that as well depending on what you make your max size.
    Corrections to my coding/thoughts welcome.

  6. #6
    Join Date
    Jun 2011
    Location
    Pearl of the East
    Posts
    54
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    sir, can you teach me how to set it through php script?,.

    like the @ini_set("memory_limit", "100M")?

    im using linux/unix os sir,.




    thx for replying,.

    God Bless,.

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Assuming you have permission on the server this should do it.

    PHP Code:
    @ini_set('post_max_size''32M'); 
    I never used this method I set it in the php.ini (the config file).
    Corrections to my coding/thoughts welcome.

  8. #8
    Join Date
    Jun 2011
    Location
    Pearl of the East
    Posts
    54
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    thx sir,. i'll try this one,. and i'll post if it's still aint working,.

    im using linux and the ini file is in read only mode,.

    how can i edit it on its php.ini sir?,.




    thank you very much,. and so sorry for my being dumb,.

    more power,.

  9. #9
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    If it it's read only it's not going to be writeable. If you have access and permissions on the server open the file and modify it. If you don't contact your host or admin and have them make the change.
    Corrections to my coding/thoughts welcome.

  10. #10
    Join Date
    Jun 2011
    Location
    Pearl of the East
    Posts
    54
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    what's the exact address of it from the php folder sir?


    EDIT:
    sir it is still ain't working,.
    the:
    PHP Code:
    @ini_set('post_max_size''32M'); 
    Last edited by regicidedelferoz; 06-28-2011 at 03:22 AM.

Bookmarks

Posting Permissions

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