diff --git a/core/Console.php b/core/Console.php
index d46bc2d2d461935b26d7334a475a1b16c89599cf..988034362ff77b35519ec3aa5f3302e69b961d2a 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -28,7 +28,7 @@ class Console extends Application
 
     public function __construct()
     {
-        $this->checkCompatibility();
+        $this->setServerArgsIfPhpCgi();
 
         parent::__construct();
 
@@ -130,13 +130,22 @@ class Console extends Application
         return $commands;
     }
 
-    private function checkCompatibility()
+    private function setServerArgsIfPhpCgi()
     {
         if (Common::isPhpCgiType()) {
-            echo 'Piwik Console is known to be not compatible with PHP-CGI (you are using '.php_sapi_name().'). ' .
-                 'Please execute console using PHP-CLI. For instance "/usr/bin/php-cli console ..."';
-            echo "\n";
-            exit(1);
+            $_SERVER['argv'] = array();
+            foreach ($_GET as $name => $value) {
+                $argument = $name;
+                if (!empty($value)) {
+                    $argument .= '=' . $value;
+                }
+
+                $_SERVER['argv'][] = $argument;
+            }
+
+            if (!defined('STDIN')) {
+                define('STDIN', fopen('php://stdin','r'));
+            }
         }
     }
 
diff --git a/misc/cron/archive.php b/misc/cron/archive.php
index bb23083f03d6d055353fd9b223d743fd0cf3c303..b2528ecf04971c92e6f28fd27f7f69d1a92e41d2 100644
--- a/misc/cron/archive.php
+++ b/misc/cron/archive.php
@@ -27,10 +27,10 @@ if (!defined('PIWIK_USER_PATH')) {
     define('PIWIK_USER_PATH', PIWIK_INCLUDE_PATH);
 }
 
-define('PIWIK_ENABLE_DISPATCH', false);
 define('PIWIK_ENABLE_ERROR_HANDLER', false);
 define('PIWIK_ENABLE_SESSION_START', false);
-require_once PIWIK_INCLUDE_PATH . "/index.php";
+
+require_once PIWIK_INCLUDE_PATH . "/core/bootstrap.php";
 
 if (!empty($_SERVER['argv'][0])) {
     $callee = $_SERVER['argv'][0];
@@ -52,8 +52,9 @@ try 'php archive.php --url=http://your.piwik/path'
 -------------------------------------------------------
 \n\n";
 }
-
-if (isset($_SERVER['argv']) && Piwik\Console::isSupported()) {
+// TODO: manual test against php-cgi + ArchiveWebTest
+//       => test w/ token auth & w/o token auth
+if (Piwik\Common::isPhpCliMode()) {
     $console = new Piwik\Console();
 
     // manipulate command line arguments so CoreArchiver command will be executed
@@ -64,41 +65,15 @@ if (isset($_SERVER['argv']) && Piwik\Console::isSupported()) {
     $console->run();
 } else { // if running via web request, use CronArchive directly
 
-    if (Piwik\Common::isPhpCliMode()) {
-        // We can run the archive in CLI with `php-cgi` so we have to configure the container/logger
-        // just like for CLI
-        $environment = new \Piwik\Application\Environment('cli');
-        $environment->init();
-
-        /** @var ConsoleHandler $consoleLogHandler */
-        $consoleLogHandler = StaticContainer::get('Symfony\Bridge\Monolog\Handler\ConsoleHandler');
-        $consoleLogHandler->setOutput(new ConsoleOutput(OutputInterface::VERBOSITY_VERBOSE));
-    } else {
-        // HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
-        $environment = new \Piwik\Application\Environment(null);
-        $environment->init();
-
-        /** @var \Monolog\Logger $logger */
-        $logger = StaticContainer::get('Psr\Log\LoggerInterface');
-        $handler = new StreamHandler('php://output', Logger::INFO);
-        $handler->setFormatter(StaticContainer::get('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter'));
-        $logger->pushHandler($handler);
-    }
-
-    \Piwik\FrontController::getInstance()->init();
-
-    $archiver = new Piwik\CronArchive();
-
-    if (!Piwik\Common::isPhpCliMode()) {
-        $token_auth = Piwik\Common::getRequestVar('token_auth', '', 'string');
+    // HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
+    /** @var \Monolog\Logger $logger */
+    $logger = StaticContainer::get('Psr\Log\LoggerInterface');
+    $handler = new StreamHandler('php://output', Logger::INFO);
+    $handler->setFormatter(StaticContainer::get('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter'));
+    $logger->pushHandler($handler);
 
-        if (!$archiver->isTokenAuthSuperUserToken($token_auth)) {
-            die('<b>You must specify the Super User token_auth as a parameter to this script, eg. <code>?token_auth=XYZ</code> if you wish to run this script through the browser. </b><br>
-                    However it is recommended to run it <a href="http://piwik.org/docs/setup-auto-archiving/">via cron in the command line</a>, since it can take a long time to run.<br/>
-                    In a shell, execute for example the following to trigger archiving on the local Piwik server:<br/>
-                    <code>$ /path/to/php /path/to/piwik/console core:archive --url=http://your-website.org/path/to/piwik/</code>');
-        }
-    }
+    $_GET['module'] = 'API';
+    $_GET['method'] = 'CoreAdminHome.runCronArchiving';
 
-    $archiver->main();
+    require_once PIWIK_INCLUDE_PATH . "/index.php";
 }
\ No newline at end of file
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php
index 2b809b792a20bfbf963ed0ceba3b0a68e3c409e4..439302d416c6c787d1f628c1184ca793531bca6e 100644
--- a/plugins/CoreAdminHome/API.php
+++ b/plugins/CoreAdminHome/API.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreAdminHome;
 use Exception;
 use Piwik\Container\StaticContainer;
 use Piwik\Archive\ArchiveInvalidator;
+use Piwik\CronArchive;
 use Piwik\Db;
 use Piwik\Piwik;
 use Piwik\Scheduler\Scheduler;
@@ -85,5 +86,16 @@ class API extends \Piwik\Plugin\API
         return $output;
     }
 
+    /**
+     * Initiates cron archiving via web request.
+     *
+     * @hideExceptForSuperUser
+     */
+    public function runCronArchiving()
+    {
+        Piwik::checkUserHasSuperUserAccess();
 
-}
+        $archiver = new CronArchive();
+        $archiver->main();
+    }
+}
\ No newline at end of file
diff --git a/plugins/CoreConsole/Commands/CoreArchiver.php b/plugins/CoreConsole/Commands/CoreArchiver.php
index 05cffb7e125ef38b0be25ff8de63fb5b4a5a8edd..9682224a67571d815b21668ae75de50b4e899b61 100644
--- a/plugins/CoreConsole/Commands/CoreArchiver.php
+++ b/plugins/CoreConsole/Commands/CoreArchiver.php
@@ -25,24 +25,14 @@ class CoreArchiver extends ConsoleCommand
 
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $url = $input->getOption('url') ?: $input->getOption('piwik-domain');
-        if (empty($url)) {
-            throw new \InvalidArgumentException("The --url argument is not set. It should be set to your Piwik URL, for example: --url=http://example.org/piwik/.");
-        }
-
-        if (is_string($url) && $url && in_array($url, array('http://', 'https://'))) {
-            // see https://github.com/piwik/piwik/issues/5180 and http://forum.piwik.org/read.php?2,115274
-            throw new \InvalidArgumentException('No valid URL given. If you have specified a valid URL try --piwik-domain instead of --url');
-        }
-
-        $archiver = self::makeArchiver($url, $input);
+        $archiver = self::makeArchiver("", $input);
         $archiver->main();
     }
 
     // also used by another console command
-    public static function makeArchiver($url, InputInterface $input)
+    public static function makeArchiver($url, InputInterface $input) // TODO: remove url from this function
     {
-        $archiver = new CronArchive($url);
+        $archiver = new CronArchive();
 
         $archiver->disableScheduledTasks = $input->getOption('disable-scheduled-tasks');
         $archiver->acceptInvalidSSLCertificate = $input->getOption("accept-invalid-ssl-certificate");
@@ -81,7 +71,7 @@ class CoreArchiver extends ConsoleCommand
   but it is recommended to run it via command line/CLI instead.
 * If you have any suggestion about this script, please let the team know at feedback@piwik.org
 * Enjoy!");
-        $command->addOption('url', null, InputOption::VALUE_REQUIRED, "Mandatory option as an alternative to '--piwik-domain'. Must be set to the Piwik base URL.\nFor example: --url=http://analytics.example.org/ or --url=https://example.org/piwik/");
+        $command->addOption('url', null, InputOption::VALUE_REQUIRED, "Deprecated.");
         $command->addOption('force-all-websites', null, InputOption::VALUE_NONE, "If specified, the script will trigger archiving on all websites.\nUse with --force-all-periods=[seconds] to also process those websites that had visits in the last [seconds] seconds.\nLaunching several processes with this option will make them share the list of sites to process.");
         $command->addOption('force-all-periods', null, InputOption::VALUE_OPTIONAL, "Limits archiving to websites with some traffic in the last [seconds] seconds. \nFor example --force-all-periods=86400 will archive websites that had visits in the last 24 hours. \nIf [seconds] is not specified, all websites with visits in the last " . CronArchive::ARCHIVE_SITES_WITH_TRAFFIC_SINCE . " seconds (" . round(CronArchive::ARCHIVE_SITES_WITH_TRAFFIC_SINCE / 86400) . " days) will be archived.");
         $command->addOption('force-timeout-for-periods', null, InputOption::VALUE_OPTIONAL, "The current week/ current month/ current year will be processed at most every [seconds].\nIf not specified, defaults to " . CronArchive::SECONDS_DELAY_BETWEEN_PERIOD_ARCHIVES . ".");
diff --git a/tests/PHPUnit/System/ArchiveWebTest.php b/tests/PHPUnit/System/ArchiveWebTest.php
index 289861327734c1db06dd6ac4618d450bf9511425..183e7d3e500262a4bbea0257aac9ab17cac86402 100644
--- a/tests/PHPUnit/System/ArchiveWebTest.php
+++ b/tests/PHPUnit/System/ArchiveWebTest.php
@@ -58,7 +58,7 @@ class ArchiveWebTest extends SystemTestCase
     {
         list($returnCode, $output) = $this->runArchivePhpScriptWithPhpCgi();
 
-        $this->assertEquals(0, $returnCode);
+        $this->assertEquals(0, $returnCode, "Output: " . $output);
         $this->assertWebArchivingDone($output, $checkArchivedSite = false);
     }