Live data from Hacker News

Show HN: FrankenPHP, an app server for PHP written in Go

frankenphp.dev

31–40 of 93 posts

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#31
post #27

PHP is already FrankenPerl, and Perl FrankenAwk? What happened to the times where some crazy person would simply slap together an interpreter and call it a language? Somehow, language creation got more and more sophisticated these days.

Really? Aren't there a lot of slapped together LLVM frontends these days?

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#32
post #26

So it's mod_php for Caddy, in reverse? The traditional idea is to build a plug-in for the parent webserver. By essentially "making a fork" of Caddy, if you want to add other plugins to Caddy and then incorporate them into FrankenPHP, it's a lot more work. If instead you ship a PHP plugin to Caddy, you can manage Caddy instead and mix and match different functionality in one place. But I guess it's heretical to sugges…

I don't think this forks Caddy. Rather, it is a Caddy plugin: https://github.com/dunglas/frankenphp/blob/main/caddy/caddy.... It uses mainline Caddy: https://github.com/dunglas/frankenphp/blob/main/caddy/go.mod

[deleted]

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#33
Good. PHP-FPM needs a challenger as anyone who has tried to debug it or its pools knows. Or to tune it (so many modes, so many configuration options).

Litespeed's PHP LSAPI [1] shows how good performance can be with other setups. It'll be great if FrankenPHP gets to the same state.

1. https://www.litespeedtech.com/open-source/litespeed-sapi/php

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#34
post #26

So it's mod_php for Caddy, in reverse? The traditional idea is to build a plug-in for the parent webserver. By essentially "making a fork" of Caddy, if you want to add other plugins to Caddy and then incorporate them into FrankenPHP, it's a lot more work. If instead you ship a PHP plugin to Caddy, you can manage Caddy instead and mix and match different functionality in one place. But I guess it's heretical to sugges…

I don't think this forks Caddy. Rather, it is a Caddy plugin: https://github.com/dunglas/frankenphp/blob/main/caddy/caddy.... It uses mainline Caddy: https://github.com/dunglas/frankenphp/blob/main/caddy/go.mod

Can I use an officially released build of Caddy and have that official Caddy executable load FrankenPHP?

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#38
post #36

What is the difference between this and Roadrunner? It seems to do the same stuff. https://github.com/roadrunner-server/roadrunner

The approach isn't the same:

Roadrunner executes php-cli and connects it to its web server through GRPC; FrankenPHP uses an ad-hoc SAPI, it is more like Apache's mod_php, the Go code uses the PHP interpreter as a library, it's all in the same process.

RoadRunner only has a worker mode, and can only work with compatible apps; FrankenPHP has a "standard" mode compatible with all existing applications, and a worker mode that requires some code changes (like RR).

RoadRunner runner uses PSR-7 HTTP messages; FrankenPHP uses plain old superglobals and streams (both in normal and in worker modes), they are reset after each handled request.

RoadRunner is battle-tested and production ready; FrankenPHP is experimental and not yet ready for production use.

FrankenPHP can also be used as a Go library to integrate PHP into any Go program or server (theoretically, it should be possible to integrate FrankenPHP into Traefik or the local Symfony web server, which are written in Go).

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#39
post #26

Earlier quoted context omitted.

I don't think this forks Caddy. Rather, it is a Caddy plugin: https://github.com/dunglas/frankenphp/blob/main/caddy/caddy.... It uses mainline Caddy: https://github.com/dunglas/frankenphp/blob/main/caddy/go.mod

Can I use an officially released build of Caddy and have that official Caddy executable load FrankenPHP?

Definitely! (using xcaddy and compiling PHP yourself, for now)

Re: Show HN: FrankenPHP, an app server for PHP written in Go

#40
post #33

Good. PHP-FPM needs a challenger as anyone who has tried to debug it or its pools knows. Or to tune it (so many modes, so many configuration options). Litespeed's PHP LSAPI [1] shows how good performance can be with other setups. It'll be great if FrankenPHP gets to the same state. 1. https://www.litespeedtech.com/open-source/litespeed-sapi/php

PHP-FPM can be so unreliable too. It'll just go down randomly without any warning or logs at all. As you said, it's impossible to debug what happens there and all you can really do is setup monitoring to detect it went down and automatically restart it.
Post reply on HN