public function getPhantomJsBinary($binDir) { $os = $this->getOS(); $binary = $binDir . '/phantomjs'; if ($os === 'windows') { // the suffix for binaries on windows is ".exe" $binary .= '.exe'; } return realpath($binary); }