diff --git a/index.php b/index.php index 77725b92a..8d8d2b62f 100644 --- a/index.php +++ b/index.php @@ -14,6 +14,12 @@ die("Please run: bin/grav install"); } +if (PHP_SAPI == 'cli-server') { + if (!isset($_SERVER['PHP_CLI_ROUTER'])) { + die("PHP webserver requires a router to run Grav, please use:
php -S {$_SERVER["SERVER_NAME"]}:{$_SERVER["SERVER_PORT"]} system/router.php"); + } +} + use Grav\Common\Grav; use RocketTheme\Toolbox\Event\Event; diff --git a/system/router.php b/system/router.php new file mode 100644 index 000000000..53e0126cf --- /dev/null +++ b/system/router.php @@ -0,0 +1,26 @@ +