by dingdingdang · 1y ago · 0 comments
* resource leaks are non-existent
Can not be emphasized enough imo. The amount of absolute ridiculous levels of pain instigated by expecting a core code loop to run -forever- and doing so well while being written for some web project or other is just too much to fathom. Just use PHP and serve the request. Then let it die. Then serve a new request.
For single-file php apps or just not using a big framework, it's not really a problem.
I wouldn’t recommend them, though.
What if you need any kind of in-memory cache? Or in general, any kind of application maintaining state, for, say, performance reasons?
And it’s not a joke, PHP is actually the most secure runtime environment out there for web hosting, PRECISELY because of the shared-nothing architecture.
Faster runtimes exist, like Swoole and recently FrankenPHP, to do evented programming like Node JS. But let me tell ya — you risk all kinds of leaks, both of unfreed memory and of secrets, across requests. It ain’t worth it most of the time!
https://www.php.net/manual/en/install.fpm.configuration.php#...