Archiving not working after upgrade to 2.1

From archiving log


INIT
Querying Piwik API at: http://myhost/index.php
Running Piwik 2.1.0 as Super User: admin
ERROR: The Piwik URL http://myhost/index.php does not seem to be pointing to a Piwik server. Response was '/usr/bin/env: wrong key -- q
Try `/usr/bin/env --help' ...
'.

Hi Viper,

which operating system and which PHP version are you using?

Debian GNU/Linux 6.0.8 (squeeze) 64bit
PHP 5.3.3

I’ve the same issue after upgrading to 2.1.0 on Debian 7

Ok let’s try to find out, replace in core/CliMulti.php the function at line 198 by this:


private function findPhpBinary()
    {
        $i = 0;
        if (defined('PHP_BINARY')) {
            var_dump(++$i . PHP_BINARY);
            return PHP_BINARY;
        }

        $bin = '';

        if (!empty($_SERVER['_']) && Common::isPhpCliMode()) {
            $bin = $this->getPhpCommandIfValid($_SERVER['_']);
            var_dump( ++$i . $bin);
        }

        if (empty($bin) && !empty($_SERVER['argv'][0]) && Common::isPhpCliMode()) {
            $bin = $this->getPhpCommandIfValid($_SERVER['argv'][0]);
            var_dump( ++$i . $bin);
        }

        if (empty($bin)) {
            $bin = shell_exec('which php');
            var_dump( ++$i . $bin);
        }

        if (empty($bin)) {
            $bin = shell_exec('which php5');
            var_dump( ++$i . $bin);
        }

        if (!empty($bin)) {
            var_dump( ++$i . $bin);
            return trim($bin);
        }
    }

Then, run the archiver script, what do you see in output?