Panel on localhost : no installation

Hi there,

I’m working on a running instance of Kirby.

I downloaded it on local. I try to access to the panel interface. It redirects me to panel/installation. But nothing shows up on the page. I have a white page.

I tried to enable panel installation on config.php, it doesn’t change anything.
I’m on MacOS, using Laravel Valet for local environment.

Could you help me?

Best!
Karl

Did you take care to copy over all files, particularly the hidden files like .htaccess? If you downloaded Kirby and unzipped it before copying on to your Valet environment, you may have left that file behind.

Hi, thanks for your answer!
I don’t think so, as we share the same git between devs and I see the .htaccess file at the root.
Do you have specific files in mind?

Hm, I also use Laravel Valet on a Mac and never ran into any issues with the Panel (since Valet uses Nginx as its server, the .htaccess is of no use and not needed).

What’s the PHP version used with your Valet install?

woops some how totally forgat that.

woops im always forgetting that.

Hi, thanks for your help !
PHP is on 8.1.17

karlpineau@MAC-KPINEAU2 www % valet php -v
PHP 8.1.17 (cli) (built: Mar 16 2023 13:19:00) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies

Any errors in console?

Which Kirby version?

Kirby version:^3.6

I have this error on the whole site, but it doesn’t make any change on kirby front:

Warning: Undefined array key "FORCE_INSECURE_HTTP" in /Users/karlpineau/Sites/designerethiques/www/index.php on line 27

And indeed, on console, i have Cross-Origin Request issue:

The URI of the module source is not allowed in this document : « https://designersethiques.test/designersethiques.org/media/panel/f91e2263a2aa0a0be4deafd52918362b/js/index.js ». installation:762:67
Uncaught (in promise) TypeError: error loading dynamically imported module 

I already tried to fix FORCE_INSECURE_HTTP, but didn’t found, and it wasn’t an issue before. Any idea to fix it?

Where does this come from? This doesn’t seem Kirby related.

Are you using https locally or http?

By default, this is an http connexion. When I try https, it’s the same.

It comes from index.php, we have this line:

$url  = ($_SERVER["FORCE_INSECURE_HTTP"] == "y" ? 'http://' : 'https://') . $host;

If I unactivate it and replace by https, I still have a white page, with few console errors:

GET
https://designersethiques.test/designersethiques.org/media/plugins/index.css?1685541330
[HTTP/2 404 Not Found 43ms]

GET
https://designersethiques.test/designersethiques.org/media/plugins/index.js?1685541330
[HTTP/2 404 Not Found 34ms]

TypeError: i.app is undefined
run.js:104:33
GET
https://designersethiques.test/designersethiques.org/media/plugins/index.js?1685541330
[HTTP/2 404 Not Found 21ms]

Fail to load <script> whose source is « https://designersethiques.test/designersethiques.org/media/plugins/index.js?1685541330 ». installation:759:152

Uncaught (in promise) SyntaxError: ambiguous indirect export: p index.js:1:184

This url seems wrong anyway, with the two domains

Please post the complete index.php

Maybe because we have several websites on the same Kirby instance ?

<?php

require 'kirby/bootstrap.php';

$host = Url::host();
$sites = [
  // local development environments
    // built-in PHP server
    // n.b.: you have to choose between DE and EBD, that's why
    //       this kind of workspace is not recommended
    'localhost' => 'designersethiques.org',
    // Valet / Docker
    'designersethiques.test' => 'designersethiques.org',
    'ethicsbydesign.test' => 'ethicsbydesign.fr',

  // cloud environments
    // DE.org
    'beta.designersethiques.org' => 'designersethiques.org',
    'designersethiques.org' => 'designersethiques.org',
    // EBD.fr
    'dev-2022.ethicsbydesign.fr' => 'ethicsbydesign.fr',
    '2022.ethicsbydesign.fr' => 'ethicsbydesign.fr',
    'ethicsbydesign.fr' => 'ethicsbydesign.fr',
];
$root = $sites[$host];

$url  = ($_SERVER["FORCE_INSECURE_HTTP"] == "y" ? 'http://' : 'https://') . $host;

# https://getkirby.com/docs/guide/configuration#custom-folder-setup
$kirby = new Kirby([
  'roots' => [
    'assets'  => $root . '/assets',
    'index'   => __DIR__,
    'site'    => __DIR__ . '/site',
    'content' => $root . '/content',
    'media'   => $root . '/media',
    // controllers
    'controllers'   => __DIR__ . '/site/controllers/'. $root,
    // blueprints
    'blueprints'   => __DIR__ . '/site/blueprints/'. $root,
    // accounts
    // templates
    'templates'   => __DIR__ . '/site/templates/'. $root,
    // snippets
    'snippets'   => __DIR__ . '/site/snippets/'. $root,
  ],
  'urls' => [
    // index
    'media'  => $url . '/' . $root . '/media',
    'assets' => $url . '/' . $root . '/assets',
  ],
]);

echo $kirby->render();