Skip to content

Instantly share code, notes, and snippets.

@jdecode
Last active July 18, 2020 05:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdecode/7dbe99f89f1904446273569c24606731 to your computer and use it in GitHub Desktop.
Save jdecode/7dbe99f89f1904446273569c24606731 to your computer and use it in GitHub Desktop.
Commands to install MySQL, PGSQL, PHP (multiple versions) in Ubuntu 19.10

Ubuntu 19.10 Date - 2020-03-02 (March 02, 2020) Apache2 - Already installed PHP 7.3 and 7.4 are the only versions currently being supported

Steps to install PHP (as per instructions on https://www.tecmint.com/install-different-php-versions-in-ubuntu/)

sudo apt install php - This installs PHP 7.3

sudo apt install software-properties-common - This was already there when I tried.

sudo add-apt-repository ppa:ondrej/php - Installs the popular repo for setting up multiple PHP versions

sudo apt install php7.3 and sudo apt install php7.4 - Installs PHP 7.3 and PHP 7.4

https://www.php.net/supported-versions.php

sudo update-alternatives --config php - Shows a list of available PHP versions to choose, and proceed from there on

https://stackoverflow.com/questions/42619312/switch-php-versions-on-commandline-ubuntu-16-04

@sssurii
Copy link

sssurii commented Jul 18, 2020

Install mostly required PHP extensions for development:
apt install php-pear php7.3-curl php7.3-dev php7.3-gd php7.3-mbstring php7.3-zip php7.3-mysql php7.3-xml php7.3-fpm libapache2-mod-php7.3 php7.3-imagick php7.3-recode php7.3-tidy php7.3-xmlrpc php7.3-intl php7.3-redis php7.3-pgsql php7.3-xdebug

For PHP 7.4, just replace the version i.e.
apt install php-pear php7.4-curl php7.4-dev php7.4-gd php7.4-mbstring php7.4-zip php7.4-mysql php7.4-xml php7.4-fpm libapache2-mod-php7.4 php7.4-imagick php7.4-recode php7.4-tidy php7.4-xmlrpc php7.4-intl php7.4-redis php7.4-pgsql php7.4-xdebug

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