Skip to content

Instantly share code, notes, and snippets.

@jitheshkt
Last active December 5, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitheshkt/e45e01b5b7431c90dbfbcb0dbc76f538 to your computer and use it in GitHub Desktop.
Save jitheshkt/e45e01b5b7431c90dbfbcb0dbc76f538 to your computer and use it in GitHub Desktop.
Setup PHP 7.4 FPM with Apache on fresh Ubuntu Instance

Setup PHP 7.4 FPM with Apache on fresh Ubuntu Instance

sudo apt update
sudo apt upgrade

Install apache

sudo apt install apache2 libapache2-mod-fcgid

Install PHP

sudo add-apt-repository ppa:ondrej/php
sudo apt update

We're installing all the basic php libs as well

sudo apt install php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-gd php7.4-imap php7.4-mbstring php7.4-soap php7.4-zip php7.4-bcmath php7.4-intl php7.4-json php7.4-opcache php7.4-readline

Lets know Apache that we're having PHP in the house

sudo a2enmod actions fcgid alias proxy_fcgi setenvif
sudo a2enconf php7.4-fpm

That's it, /var/www/html is your root directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment