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
- 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
.
- Add the ondrej/php PPA repository (which provides PHP 7.4):
- 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.
- Confirm that the PHP-FPM service is running:
- 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
- Enable the necessary Apache modules for FastCGI:
Now PHP-FPM installed and configured with Apache on Ubuntu 20.04 system!
Leave a Reply