替换命令中的错误标志:'i'.sql

Running a database migrate in PHP (via Phing), I'm getting the following FAILED BUILD error:

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:

as well as several warnings along similar lines:

[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]

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:

protected function createOutputFile($file, $undo = false)
{
    $fileHandle = fopen($file, "w+");
    $sql = $this->generateSql($undo);
    fwrite($fileHandle, $sql);
}

With createOutputFile called from within the deploy function:

protected function deploy()
{
    // create deploy outputfile
    $this->createOutputFile($this->outputFile, false);

    // create undo deploy outputfile
    $this->createOutputFile($this->undoOutputFile, true);
}

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?