3
devall@giga:~$ sudo apt-get install php7.1 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.1
E: Couldn't find any package by glob 'php7.1'
E: Couldn't find any package by regex 'php7.1'

I am trying to install php 7.1 , tried almost everything...

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

reinstalled ubuntu twice.. still same error. #help

Mehdi
  • 717
  • 1
  • 7
  • 21
Giga Todadze
  • 63
  • 1
  • 11

1 Answers1

4

try with software-properties-common

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt search php7
sudo apt install php7.1
php -v
Nathanael
  • 870
  • 5
  • 11
  • I just tried this and I am still getting the same error as OP, trying to install both PHP 7.1 and 7.2. Got the above error that it couldn't find 7.1, and when I tried to install 7.2, it installed 7.3 instead. – Erica S. Jan 18 '21 at 19:53
  • @EricaSummers, if you want to install multiple versions of php, you will be better off to use docker containers with one version for each container – Nathanael Jan 20 '21 at 20:02
  • I was not looking to install multiple versions, I was trying to get either 7.1 or 7.2 but for some reason it could only find and install 7.3, no earlier versions. I don't know if that was a recent change due to the latest 8 release or what reason it could be... – Erica S. Jan 21 '21 at 02:13