Brief guide on how to install PHP-FPM (FastCGI Process Manager) on Ubuntu 20.04

Install Apache and FastCGI Module:

  • First, update your system’s package list: sudo apt update
  • Then install Apache and the FastCGI module: sudo apt install apache2 libapache2-mod-fcgid
  1. Install PHP with FPM:
    • Add the ondrej/php PPA repository (which provides PHP 7.4): sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php
    • Install PHP 7.4 and PHP-FPM: sudo apt update sudo apt install php7.4 php7.4-fpm
    • Note that PHP-FPM configurations are located under /etc/php/7.4/fpm.
  2. Verify PHP-FPM Service:
    • Confirm that the PHP-FPM service is running: sudo systemctl status php7.4-fpm
    • You should see output indicating that the service is active.
  3. Configure Apache:
    • Enable the necessary Apache modules for FastCGI: sudo a2enmod proxy_fcgi setenvif sudo a2enconf php7.4-fpm
    • Restart Apache: sudo systemctl restart apache2

Now PHP-FPM installed and configured with Apache on Ubuntu 20.04 system!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *