Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/15/2021 in all areas

  1. The old school way of running php with apache was to use the mod_php apache module, which makes php a part of apache. So that was certainly different. You can think of php-fpm as a "php server" process. Using it with apache or nginx or any other http proxy means that php-fpm is running separately and being communicated with from the http server via fastcgi. Fastcgi is a specification that evolved from the original cgi spec, that was the earliest way a web server could be configured to send data to and from an external program. php-fpm is a php server that implements fastcgi, so it can be used with any http server or proxy that also supports fastcgi. One of the obvious things to notice is that the effective user running the php script can be different than the user that the apache process is running as. It also has some efficiency when compared to mod_php, for reasons I won't go into, but that I did examine in a blog post I made. One big problem with mod_php is that the apache child processes tend to grow and absorb memory when serving php, and this pool of child processes has to be used for every request, so even if apache is handling a request to return an image or css file, or other static content, the apache child process might be 500mb in terms of memory usage, because previously it had been used to run a php script. This is a big reason that nginx became popular, as it was always intended to be a high performance proxy, and always used fastcgi. With that said, when php-fpm runs a php process it still does so using the php configuration. It does have its own settings to manage fastcgi, so in that way it's got another group of settings that you have to configure, and areas where the communication between apache and php-fpm can have issues, so in that way it's more complicated.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.