Skip to content

Instantly share code, notes, and snippets.

@swooningfish
Last active August 17, 2022 19:35
Show Gist options
  • Save swooningfish/4489632fc118f618c0e84f67d740fd0d to your computer and use it in GitHub Desktop.
Save swooningfish/4489632fc118f618c0e84f67d740fd0d to your computer and use it in GitHub Desktop.
How to install PHP 8.0.x fpm with nginx on ubuntu 20.04
# source : https://linuxize.com/post/how-to-install-php-8-on-ubuntu-20-04/
# Enableging the PHP Repo
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
# Nginx cconfig to specify which php fpm sock to use.
/etc/nginx/sites-enabled/site.local
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
# Show installed php packages
dpkg --get-selections | grep php
# Install PHP 8.0-fpm and extensions
sudo apt install php8.0-fpm php8.0-mysql php8.0-gd php8.0-mbstring php8.0-curl php8.0-dom php8.0-imagick
systemctl status php8.0-fpm
sudo systemctl restart nginx
sudo systemctl restart php8.0-fpm
# set default cli on ubuntu
# Source: https://stackoverflow.com/questions/42619312/switch-php-versions-on-commandline-ubuntu-16-04
sudo update-alternatives --set php /usr/bin/php8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment