Skip to content

Instantly share code, notes, and snippets.

@junibrosas
Last active November 22, 2022 08:53
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 junibrosas/c64ea8088cf36a914c3c65a05268302c to your computer and use it in GitHub Desktop.
Save junibrosas/c64ea8088cf36a914c3c65a05268302c to your computer and use it in GitHub Desktop.
Installing PHP 7.4

Update Ubuntu

sudo apt update && sudo apt upgrade

Install Required Packages

sudo apt install software-properties-common apt-transport-https -y

Import Ondřej Surý PHP Repository

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

Install PHP 7.4 with Apache Option

sudo apt install php7.4 php7.4-common libapache2-mod-php7.4 php7.4-cli

restart your Apache server to load the new PHP module.

sudo systemctl restart apache2

Or restart NGinx server if you are running.

sudo systemctl restart nginx

Install PHP7.4-FPM and Other Extensions

sudo apt-get install php7.4-fpm php7.4-cli php7.4-mysql php7.4-curl php7.4-json -y

start the PHP7.4-FPM service and enable it to start at system reboot:

sudo systemctl start php7.4-fpm
sudo systemctl enable php7.4-fpm

Restart Nginx

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