FrankenPHP & Kirby CMS

Hi,

I’m attempting to run Kirby CMS with the FrankenPHP webserver, locally using devenv.

I have used Composer to setup a clean getkirby/starterkit project. My devenv.nix file is as follows:

{ pkgs, lib, config, ... }:

{
  services.caddy = {
    enable = lib.mkDefault true;
    package = pkgs.frankenphp;

    config = ''
      {
        frankenphp
      }

      :8000 {

        root * .
        encode zstd br gzip

        php_server
      }
    '';
  };
}

Opening the home page works just fine, however trying to load the panel after creating an account results in the following error message:
{"status":"error","message":"No route found for path: \"system\/install\" and request method: \"GET\"","code":404,"exception":"Exception","key":null,"file":"\/kirby\/src\/Http\/Router.php","line":185,"details":[],"route":null}

Would be very cool if this could work! :crossed_fingers:

Edit:
The above config works just fine with Kirby 3.10.1.1 instead of 4.5.0.

Hi @nohT8ak8,
I’m experiencing the same issue with FrankenPHP with a simple Docker / Docker Compose setup when using the dunglas/frankenphp:php8.3-alpine image.

Have you found a solution in the meantime?
Thanks!

Edit: When I am running caddy in debug mode I get invalid header logs on every request:
DEBUG invalid header {"header": "Content-Type:text/html; charset=UTF-8"}
Maybe it has to do something with that. But didn’t have the time to dive in deeper yet.

Best regards
Lasse

Hi @lassereinboeng,

Thanks for your reply.

The invalid header message is interesting, however the message also occurs on Kirby 3.10.1.1. For that reason I believe it’s not related to the problem.

Hi @nohT8ak8,

ah, I see. I wish I knew how to debug why API routes are not working but I don’t know where to start.
Other custom routes registered in the config seem to work just fine. I have the feeling that it must be something weird with the API routes in general and/or authentication.

Would be nice if someone from the Kirby team could look into the issue. FrankenPHP with Kirby seems very promising to me!

Have a nice day!
Lasse

Hi @nohT8ak8,
in the meantime I opened up an issue on Github: Panel API routes not working with FrankenPHP in Kirby 4 · Issue #6975 · getkirby/kirby · GitHub
Maybe someone from the team can look into the issue or has a recommendation how to start searching for the problem.

This is now fixed in 4.6.1 thanks to @rasteiner Kirby 4.6.1 is here

2 Likes

Hi, I can confirm! Updating to 4.6.1 fixes the issue! Thanks.

3 Likes