I am trying to run the mysqldump program and redirect the output to a file. this works fine but i now want to do this with the verbose (-v) option on and show some of the info to the user. It works at the command line but not in the script. any ideas?
$file = "/mypath/" . CONST_DBASE . ".sql";
$cmd = "/usr/bin/mysqldump -u " . CONST_DBUSER . " -v -p" . CONST_DBPASSWORD . " " . CONST_DBASE . ">" . $file;
$output = array(); $result = 0;
exec($cmd, $output, $result);
echo ("<p>" . $cmd . " returned ". $result . "</p><pre>" . implode("\n", $output) . "</pre>");
also tried appending "2>&1" to the end of the command to see the contents of the STD_ERROR but that didn't do the job either.
Thanks in advance
Kris