Skip to content

Serverless: From a PHP Developer’s Experience

I never really got the point of “serverless.” It seems kinda no-duh, like someone inventing another kind of wheel. I’ve spent the last couple of days dabbling with it. And now I get it, it’s PHP-FPM for other languages.

See, us PHP developers have basically had “serverless” for quite some time. PHP-FPM is what we used for years (decades?). Basically we’ve written little functions that only load what they need and execution even has to “warm up” just like serverless (aka, the opcache).

The biggest difference between PHP-FPM and serverless is with PHP-FPM, you need to set it up and run a server. There’s currently no serverless architecture that natively runs PHP (except maybe, Azure, with a few tweaks).

Why Someone Needs to Run Serverless PHP Natively

A ridiculously large portion of the internet already runs PHP. If I could host my PHP application/API in a serverless architecture, a ton of my personal “play money” could be spent on better things.

At the same time, this is suicide for all hosting companies that currently host all websites. Suddenly, no one would need servers. PHP would be, quite literally, the easiest migration to serverless known to mankind.

Until Then…

Someone should build a way (using the existing known hacks) to migrate a WordPress install to one of the serverless platforms to execute as though it’s running on a native server. There’s currently hacks to convert WordPress sites to static html (but that’s just a marketing gimmick — nginx + PHP-FPM has that built in and is currently what you’re reading now). I’m talking about a real WordPress install, running PHP with some kind of cache in-place on the API gateway.

%d bloggers like this: