SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2002
    Location
    Scotland, UK
    Posts
    530
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using GZIP inside my PHP scripts

    Hi folks,

    I was wondering how you go about using GZIP (or another file compressor) from within your PHP scripts when run on a Linux server.

    I have a script that backs up my forum to a .SQL file and then I download this but since the size is 80mb it takes a while.

    What I wanted to do was use GZIP to compress it first so the filesize would be smaller for transfer.

    I think my hosting company uses an older version of PHP 4 and Apache so will it still work ok?

    Thanks.

    R.

  2. #2
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the php module has Zlib installed then it should be fine.....

    Using the Zlib functions is pretty much exactly the same as the normal file functions. Just use gzfile(), gzopen(), gzread(), gzwrite(), gzclose() etc.........
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you doing the dump? Are you exec()ing mysqldump?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •