CakePHP with Openswoole/Swoole or FrankenPHP

I’m trying to connect CakePHP with OpenSwoole or FrankenPHP. I didn’t want to use Apache or even NGINX directly, but I’m having a lot of difficulties.

I used the other framework and it works okay, but my heart is with CakePHP, haha.

Sometimes it doesn’t load static files, sometimes it doesn’t load routes, and sometimes it doesn’t load a bunch of other things. It feels like CakePHP was designed only for a specific web server… Even if I use CakePHP’s built-in web server via CLI, the performance is worse than using Apache. Does anyone have a tutorial on how to set this up?

a quick google search should have lead you to this repository eventually but here you go

you need a custom app template so that it works with openswoole

be aware, that this is just an example, not an official openswoole template so you probably need to adjust some things yourself

I even saw this, but it doesn’t work the way I expected, and there are some errors that I really couldn’t solve. I even used it as a base, but on the second request, I was already getting a ‘cache already loaded’ error, for example. :confused:

CakePHP doesn’t have any built-in web server. The server command just fires up PHP’s built-in web server, which is meant for development purposes only.

:confused: I had an idea here, as I can access the controller from another location I will use swoole http with slim for the API and just call the cakephp controller for things… that’s not it, but performance/access/scalability I maintain, while direct access to cake would work as a frontend (which is not ideal) but nothing that a loadbalance can solve… (sorry english…)

I’m going to do something like this, there’s no way to expose the entire application :confused: