0

When I manually run the output from print it works fine. However the actual program produces the following error:

sh: /mysqldump: No such file or directory

<?php

$backupFile = "backup/wordpress" . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump -hlocalhost -uusername -ppassword dbname | gzip > $backupFile";
print $command;
system($command);


?>

2 Answers 2

1

try adding the full path in front of mysqldump

Sign up to request clarification or add additional context in comments.

Comments

0

You need to specify the full path to the mysqldump command line tool.

Entering...

which mysqldump

...from the shell will tell you the necessary path.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.