views:

148

answers:

1

When I output my MySQL Dump Regularly, it outputs a 30MB File. When I use gzip, 0KB.

Here is my code:

$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname  | gzip>  test.sql.gz";
system($command);

Result: test.sql.gz 0 KB

---------------------------

$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname  > test.sql";
system($command);

Result: test.sql 30 MB
A: 

Do you need to specify a full path to gzip, instead of just gzip? I'm not sure what your default path will be from within PHP, but it often doesn't cover everything you'd want.

James