Roughly 1/3 of the internet runs on httpd, but it seems like a lot of developers have no idea how to configure it, let alone remember it exists.

Having to explain what FastCGI is or basic httpd directives is something I feel like I’m doing more and more.

@dragonmantank So… when I use httpd, I normally use mod_php and let httpd take care of all the processes. Is there a reason to use FastCGI over that?

At $dayjob, we use nginx with PHP-FPM for PHP and Nest.js/Express for Node.js. I know I’m the odd one out with my love for the simplicity of mod_php, but I don’t think many of the other popular languages had something as simple, so they had to go the FastCGI route.

@ramsey @dragonmantank The cool thing you can do with FastCGI and PHP-FPM over mod_php is that you can have multiple machines running multiple PHP-FPM pools, with a single web server sitting in front of them. It's another way to scale, basically. And that means you can keep the two separate, which can allow you to do things like add another Apache or nginx instance without needing to take down PHP.

@mwop @ramsey Yeah, that's the biggest reason. Of you want a single web server pushing out to multiple languages via FastCGI.

Performance-wise it's pretty much equal between the two at the end-of-the-day. Most of the time I still do mod_php just because it's a single container and setup, especially to get started. I'd rather reduce complexity than worry about .01ms of response time.

@dragonmantank @ramsey Where it gets interesting is it allows you to add another web server — e.g., to update to a newer version to pick up a security fix, or to change configuration — and then change over your load balancer to point to that instance instead of the old one. Zero down-time for those hitting your site(s)/application(s).

Again, these are mainly problems for those who need scale or uptime guarantees. For the vast majority, it's likely overkill.

@dragonmantank @ramsey That said: I've played a lot with Caddy, and there are things I appreciate about it:

- ACME built-in. I literally need to do nothing to automatically have TLS, and HSTS etc are easy to config.
- I can route to S3-compatible storage for static assets.
- I can connect FastCGI pools or reverse proxy with 1 config directive.

I can do Apache configuration pretty easily, and I'm reasonably versed in nginx. But Caddy has learned from each, and hits some sweet spots.

@mwop @ramsey Caddy is my go-to for when I'm doing FastCGI stuff nowadays as well
@dragonmantank @mwop I have a lot of trouble grokking the Caddy syntax, and its documentation doesn’t help very much. It’s all very hand-wavy and imprecise, IMO. Additionally, searching for anything Caddy-related turns up blog posts from years ago, and none of them are related to the new syntax.

@ramsey @dragonmantank That was what Apache was like back in the late 90s early 00s as well, Ben.

Oh, crap, did I just type that?

I'm an old.

@mwop @dragonmantank True… all the Apache 1.x docs and tutorials floating around, while Apache 2.x was already on the scene.
@ramsey @mwop Or today when I had to point out FallbackResource in favor of mod_rewrite because the first Google answer was a StackOverflow answer that was out of date.

@dragonmantank @ramsey @mwop im still suffering finding apache 2.2 docs now that 2.4 has been pushed (finally, omg) mainstream in all the repos.

and there are enough differences to be annoying. good ones. but.

@dragonmantank @ramsey @mwop also been keeping my eye on https://frankenphp.dev/

it is caddy based though and i just havent been able to dedicate the time to research the things i know i need to know across topics like app config, scaling, and attack mitigation.

FrankenPHP: the modern PHP app server

FrankenPHP is a new app server for PHP apps (built on top of Caddy) and a library to embed the PHP interpreter in Go web servers.

@bobmagicii @ramsey @mwop I'm still not sold on alternative engines/dedicated servers for PHP, I still feel like we are still well served by dedicated server software rather than bundling it all into one thing.
@dragonmantank @ramsey @mwop i agree, but there are a few neat sounding things like this i watch, because im dreading the day i wake up to an email from the new cool kids on internals who are edging out the old guard, that mod_php is going away.
@ramsey @dragonmantank @mwop That's definitely how I feel about Caddy as well — I like the functionality, but I don't deal with it enough to have things in working memory, and I find the docs don't really do anything to bridge the gap between "I have a problem that looks 80% like X that there's a guide for" and "here is the terse reference page for Y that lists the attributes in the bespoke DSL that isn't quite like anything else". Combining that with lots of outdated blogs is not a great time.