hi,
i try to run this script to backup my db but the file downloaded isn't valid and has a wrong size on disk.
Can you help me to find the error?
thanks so much

    Last comment there suggests the script outputs a header specifying the wrong MIME type. 😉

    But I like Weed's suggestion; I bet you could backup your DB with a couple system calls to mysqldump and a lot less code than that project seems to want to use.

    I know we do here.

      mysqldump is fast and powerful and flexible and essentially amazing. If you have command-line access to your server, I would strongly recommend that you learn to use it. You can start with a simple command:

      mysqldump -h localhost -u your_username -p your_database_name > your_backup_file.txt 

        sorry but I don't have command-line access to web server, i'm using a web hosting, so I can do it only via php script.

        One thing I dont' understand: why to disable this:
        @ini_set('zlib.output_compression','Off');

        when the output_compression parameter does just the output compression?

          joane1;11045267 wrote:

          sorry but I don't have command-line access to web server, i'm using a web hosting, so I can do it only via php script.

          This doesn't definitively rule out the use of mysqldump via [man]exec[/man] but other aspects of your server might preclude this possibility. Mysqldump is a truly useful tool and you would benefit from knowing how to use it.

          joane1;11045267 wrote:

          One thing I dont' understand: why to disable this:
          @ini_set('zlib.output_compression','Off');

          when the output_compression parameter does just the output compression?

          If you read the script more carefully, you should see that it uses the function [man]gzencode[/man] explicitly in the script so you don't really want Apache to recompress it. This would accomplish nothing (gzip files really don't compress) and might possibly result in a corr

          You ignored Dalecosp's post. The last comment on that page you linked might solve your problem:

          joane1;11045267 wrote:

          Hi,
          the 'Content-Type: application/x-download' seems not valid. It need x-gzip instead

            sneakyimp;11045269 wrote:

            If you read the script more carefully, you should see that it uses the function [man]gzencode[/man] explicitly in the script so you don't really want Apache to recompress it. This would accomplish nothing (gzip files really don't compress) and might possibly result in a corr

            ok, so I can remove the @ini_set('zlib.output_compression','Off'); command, right?

              joane1;11045295 wrote:

              ok, so I can remove the @ini_set('zlib.output_compression','Off'); command, right?

              Um, NO. Are you reading our responses?

                Write a Reply...