title: Difference between php-fpm with libapache2-mod-fcgid and/or libapache2-mod-fastcgi
body: <p>right now I'm installing or new apache2 webserver with <strong>PHP-FPM</strong>, because the old one is running with mod_php.</p>
  
  <p>I found different Tutorials at the internet,  unlikely most of them 1-2 years old. Most of them use:</p>
  
  <p><strong>libapache2-mod-fastcgi</strong> in combination with Apache and PHP-FPM.</p>
  
  <p>At the Ubuntu 18.04 Repository this package is not available, just the package:</p>
  
  <p><strong>libapache2-mod-fcgid</strong></p>
  
  <p>Which of them can I use now ? Or what is the difference between both of them ? Unfortunately I cant really find a good explanation at the internet.</p>
  
  <p>Furthermore I often read about</p>
  
  <p><strong>mod_proxy_fcgi</strong></p>
  
  <p>does that mean I dont need the libaapche2-mod-f... packages anymore ? ?</p>
  
  <p>Right now I installed everything like this and it works, but I'm not sure If this is the right way:</p>
  
  <pre><code>a2enmod actions fastcgi alias proxy_fcgi
  apt install php-7.2 php7.2-fpm php7.2-gd php7.2-mysql php7.2-curl php7.2-xml php7.2-zip php7.2-intl php7.2-mbstring php7.2-bz2 php7.2-json php7.2-apcu php7.2-imagick
  a2enmod actions fastcgi alias proxy_fcgi
  </code></pre>
  
  <p>vHost:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
  
      &lt;FilesMatch \.php$&gt;
           SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/"
      &lt;/FilesMatch&gt;
  
      DocumentRoot /var/www/html
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>PHP-FPM is running (see picture of info.php):
  <a href="https://i.stack.imgur.com/PWdjN.png" rel="nofollow noreferrer">PHP-FPM Working</a></p>
  
  <p>And what is the difference between:</p>
  
  <p><strong>SetHandler</strong> and <strong>FastCgiExternalServer</strong> and <strong>ProxyPassMatch ^/(.<em>.php(/.</em>)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1</strong></p>
  
  <p>?</p>
  
  <p>I've got the feeling, that every tutorial is telling me something different and I cant really figure out what the best practice is in 2018 with Ubuntu2018.</p>