title: MySQL database backup using PHP
body: <p>I have used the following to check if <code>exec()</code> is enabled  on my server:</p>
  
  <pre><code>public function exec_enabled() {
    $disabled = explode(',', ini_get('disable_functions'));
    return !in_array('exec', $disabled);
  }
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>exec('mysqldump --user=foo --password=bar --host=localhost foobar &gt; backup.sql');
  </code></pre>
  
  <p>I have also tried</p>
  
  <pre><code>exec('mysqldump -u foo -p bar foobar &gt; backup.sql');
  </code></pre>
  
  <p>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?</p>