PHP-FPM is better!
Some years ago there was CGI, which is just a simple script in any lanuage that gets executed by the web-server to render some data back to the browser.
Each CGI script for sure gets executed in a separate process each time there is a request, that's how PHP was started like a lot of old but gold technologies.
By the time they noticed that applying that flow isn't good for high traffic due to the cost of opining new process as well as the OS letancy during spawning new Process.
That's why the guys working on PHP introduced FPM which is a FastCGI based process manager that serves the incoming requests via FastCGI protocol, but solves a lot of performance, memory and process management problems, simply, it is a master process that has some children processes that serve the requests, you can tell FPM to make it dynamic, ondemand or static number of workers.
All of that heavy developments are done over many years and tested in production.
The PHP is well designed to execute one script correctly in a dedicated process, and everything in the ecosystem is as that too, so why are we reinventing the wheel by creating async php runtimes, we're recreating fpm again with the same result but in different paradigms, PHP has many new powerful features as well its performance has been enhanced a lot, there are many rooms of optimizations.
If you're looking for an easy way to run your laravel/symfony app on fpm without understanding or thinking about configs, just try phoo.
Subscribe to my newsletter
Read articles from Mohammed Al Ashaal directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by