title: Bad flag in substitute command: 'i'.sql
body: <p>Running a database migrate in PHP (via Phing), I'm getting the following <code>FAILED BUILD</code> error:</p>
  
  <pre><code>Unable to open /site/thewebsite.co.uk/data/migrate-web_site-sed: 1:   "s/[^a-z0-9]/-/gi": bad flag in substitute command: 'i'.sql for reading:
  </code></pre>
  
  <p>as well as several warnings along similar lines:</p>
  
  <pre><code>[PHP Error] fopen(/site/thewebsite.co.uk/data/migrate-web_site-sed 1: "s/[^a-z0-9]/-/gi": bad flag in substitute command: 'i'.sql): failed to open stream: No such file or directory [line 224 of /site/thewebsite.co.uk/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php]
  </code></pre>
  
  <p>Does anyone have ideas about where to start looking for a resolution and/or the cause of the problem? The site files were cloned from a previously working repository and to my knowledge the DbDeployTask.php file has not been changed by any of my co-workers since the last working copy was cloned. I've had a look through the relevant .php file and I can't see any obvious issues. The section of the code referenced looks pretty standard:</p>
  
  <pre><code>protected function createOutputFile($file, $undo = false)
  {
      $fileHandle = fopen($file, "w+");
      $sql = $this-&gt;generateSql($undo);
      fwrite($fileHandle, $sql);
  }
  </code></pre>
  
  <p>With createOutputFile called from within the deploy function:</p>
  
  <pre><code>protected function deploy()
  {
      // create deploy outputfile
      $this-&gt;createOutputFile($this-&gt;outputFile, false);
  
      // create undo deploy outputfile
      $this-&gt;createOutputFile($this-&gt;undoOutputFile, true);
  }
  </code></pre>
  
  <p>Where would people advise looking for the source of this issue, so our Apache server is able to deploy the development website correctly on this Macintosh?</p>