title: PHP MySQL Backup script on IIS Server
body: <p>Bit of a newbie, so please excuse the lack of terminology. . . .
  I have a PHP script to backup a MySQL database "dbjobs".
  I've tried nearly everything I can but can't get it to work.
  It works if I run the $command directly from the Command Prompt on the server, but everytime I try to run the PHP version, I get an HTTP 500 error.</p>
  
  <pre><code>&lt;?php
  $backupFile = "DBJobs_" . date("Y-m-d");
  $command = "\"mysqldump.exe\" --opt -hlocalhost -uUser -pPasswword dbjobs &gt; c:/backup.sql";
  $result = system($command);
  
  if ($command !== false) {
  echo "&lt;p&gt;Backup file created!&lt;/p&gt;";
  }
  else {
    echo "&lt;p&gt;There was a problem!&lt;/p&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>I have tried the exec() function instead of system() but still does the same.
  Does anyone know where I am going wrong?</p>
  
  <p>Thanks</p>