Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8143729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:11:39+00:00 2026-06-06T13:11:39+00:00

I have a gzipped text file that I’m trying to read within PHP (using

  • 0

I have a gzipped text file that I’m trying to read within PHP (using gzopen/gzgets). The file is somewhat large, around 158,000 lines. The script works fine except when it gets to line 157,237 of the file, it reads in part of the line then acts as if it’s reached EOF. I’m able to unzip the file and confirm the rest of the file does exist. I wrote a simple script to test:

<?php
    $handle = gzopen('/path/to/file.gz','r');
    while(true) {
        echo gzgets($handle,4096);
    }
?>

It reads in everything perfectly then suddenly gets to this line and prints:

GUAN XIN 508|R34745|CH|CGO|100| 

and nothing else. It just sits there [the not-infinite-loop version exits the while(!gzeof($handle))]

If I gunzip the file and go to that line, I see:

GUAN XIN 508|R34745|CH|CGO|100| | | | |BEGS| | | | |133|19| | | | | | | | | | | | |413669000|1|

So the data is there. Is there some sort of size limitation on the zlib functions that I’m not aware of?

UPDATE: I ran it through a ‘cat -vet’ to look for special characters… nothing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:11:40+00:00Added an answer on June 6, 2026 at 1:11 pm

    Updated zlib to 1.2.7. We were running 1.2.3, and “large file” support was apparently added in 1.2.4.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that is 310MB in size (uncompressed). When using PerlIO::gzip
I have some gzipped files that I want to read in C via fopen
I have a large (3GB), gzipped file containing two fields: NAME and STRING. I
I'm trying to pull a gzipped json file from http://api.discogs.com/release/339901 . I have https://github.com/waveto/node-compress
I have this program that takes one argument for the source file and then
I have some code that downloads gzipped files, and decompresses them. The problem is,
I have a D program with Tango and I'm trying to uncompress a gzipped
Assume I have a regular fixed width file that is sorted on one of
I am trying to send gzipped content from the server. I have gzipped a
Situation: I have many gzipped input files that I want to process in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.