Skip to content

Instantly share code, notes, and snippets.

@Bazsmagister
Last active June 27, 2024 13:05
Show Gist options
  • Save Bazsmagister/a229b238eb8cb5394873434070e940df to your computer and use it in GitHub Desktop.
Save Bazsmagister/a229b238eb8cb5394873434070e940df to your computer and use it in GitHub Desktop.
PHP update from PPA on LinuxMint19.3
Source is:
https://computingforgeeks.com/how-to-install-php-7-3-php-7-3-fpm-on-linux-mint-19/
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:ondrej/php
sudo apt update
---
Install php7.4:
sudo apt-get install php7.4
extension to PHP 7.3:
sudo apt install php7.3-cli php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json
extension to PHP 7.4:
sudo apt install php7.4-cli php7.4-json php7.4-pdo php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-json
//sudo apt install php7.4-dom
//answer:
//Note, selecting 'php7.4-xml' instead of 'php7.4-dom'
//php7.4-xml is already the newest version (7.4.6-1+ubuntu18.04.1+deb.sury.org+1).
//The following packages were automatically installed and are no longer required:
---
Install php8.2:
sudo apt install php8.2
sudo apt install php8.2-cli php8.2-xml php8.2-dom php8.2-pdo php8.2-mysql php8.2-zip
sudo apt install php8.2-mbstring php8.2-curl php8.2-bcmath php8.2-gd
---
remove php8:
sudo apt-get purge php8.0-common
or on zsh:
sudo apt purge 'php8.*'
//If using zsh and having problems with the command above like: 'zsh: no matches found: php8.*'
//https://askubuntu.com/questions/487343/how-to-completely-remove-php-libraries
Solution:
zsh, unlike bash, has a different glob/wildcard/expansion system, so it works differently so php*might not work as you expect.
So are instead of sudo apt-get remove php*, you could:
Quote it:
sudo apt-get remove "php*"
Or Bash it:
bash -c "sudo apt-get remove php*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment