I have the following code.
<?php
$command = '/usr/bin/mysqldump --user=marvin --password=mypassword --host=localhost opencart_status > /var/www/marvin/backup.sql';
$result = passthru($command, $report);
if(!$report){
echo "Error!";
}
else{
echo "OK";
}
?>
I tried to run the $command
on putty in linux and everything is OK. But when I ran it in my php scirpt, the output was "OK" (echo "OK"
), but no backup.sql was in my folder.