I have used the following to check if exec()
is enabled on my server:
public function exec_enabled() {
$disabled = explode(',', ini_get('disable_functions'));
return !in_array('exec', $disabled);
}
And I found out that it was enabled on my server. Now I am trying to run the following, and the database isn't getting backed up:
exec('mysqldump --user=foo --password=bar --host=localhost foobar > backup.sql');
I have also tried
exec('mysqldump -u foo -p bar foobar > backup.sql');
But it didn't work either. Also, I am not getting any errors (error reporting is on). Can anyone please tell me what am I doing wrong here?