2
votes

I'm installing php7.0-fpm on a Debian server. Do I also need to install the libapache2-mod-php7.0 package? The Debian package page for php7.0-fpm seems ambiguous to me. It says,

This package provides the Fast Process Manager interpreter that runs as a daemon and receives Fast/CGI requests. Note that MOST Apache users probably want the libapache2-mod-php7.0 package.

Does this mean most Apache users want the libapache2 package instead of php7.0-fpm or does it mean that most users also want to install the libapache package? What is the exact difference between what each of these packages does?

1
Those are 2 different SAPIs. One does not need the other to function.zerkms
I found that PHP wouldn't work until I installed the libapache2 package.Jim
That's totally not the case. It only means you could not configure php-fpm and apache together.zerkms
Yes, after doing more research, I think you're correct. Installing libapache caused PHP to switch over to mod_PHP instead of using PHP-FPM. I'm going to look at this again tomorrow. Thanks for your help!Jim

1 Answers

0
votes

If you would like to use mod_php directly from Apache, then you want to use libapache2 package. This package requires that Apache run in single thread mode (Aka PreFork MPM). If you would like to use PHP with Nginx or Apache's threaded Worker MPM (with fastcgi), then you will want to use the FPM package. This has the advantage of using threads and recycling of php worker processes which, generally speaking, will yield far better performance.

I think the note "that MOST Apache users probably want the libapache2-mod-php7.0 package." is basically there because it is much easier to setup Apache for mod_php than it is for FastCGI so users using Apache tend to follow that approche. Setting up FPM with Nginx is far simpler and Nginx does a more efficient job of proxying the requests to the FPM process. If you are only using the web server to provide PHP execution and dont need some of the Apache specific bells and whistles, then you will probably be better off using Nginx in the long run.