I am trying to setup Kirby v3 above the web root but I cannot get it to run in my local dev env (php -s with router script flag).
Here is how the folder structure looks like:
/kirby /site /content /www # → The web root — .htaccess — index.php /assets /media
index.php I have the following:
# index.php <?php include '../kirby/bootstrap.php'; $kirby = new Kirby([ 'roots' => [ 'index' => __DIR__, 'content' => __DIR__ . '/../content', 'site' => __DIR__ . '/../site', ], ]); echo $kirby->render();
When I start it with
cd /www && php -S localhost:8000 ../kirby/router.php I get errors in
Kirby/router.php (assuming because the
$root var doesn’t point to the correct
__DIR__). If I omit the router script the server starts up but then no media is found.
Any thoughts on this?
Also: Can the
/media folder also be placed outside the webroot?