M HYPE SPLASH
// general

How to install php7.2 in Ubuntu 19.10

By Emily Wilson

I have recently upgraded to Ubuntu 19.10 from 19.04. When I tried to install some package it asked me to remove many packages by autoremove. So I run the command and it removed the php7.2-fpm.

Now I am unable to install php7.2-fpm.

$ sudo apt-get install php7.2-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php7.2-fpm is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

I tried to add ondrej PPA. But still it is not working.

Please help.

My netbeans also stopped working.

UPDATE

I am now able to use netbeans by installing JDK13. I am still forced to use PHP7.3. I am not able to use PHP7.2. Someone asked me to show output of sudo apt-get update. So I am posting it here:

xxx@Ubuntu-PC:~$ sudo apt-get update
[sudo] password for xxx:
Hit:1 eoan InRelease
Hit:2 eoan InRelease
Hit:3 eoan-updates InRelease
Hit:4 eoan-security InRelease
Hit:5 eoan InRelease
Hit:6 stable InRelease
Hit:7 stable InRelease
Ign:8 stable InRelease
Hit:9 stable Release
Reading package lists... Done
3

2 Answers

You should use the replacement python package to be able to register ondrej's PPA

sudo apt install software-properties-common

Installing the package

Then register the PPA

add-apt-repository ppa:ondrej/php

Now you can install your PHP packages

sudo apt-get install php7.2 php7.2-fpm php7.2-cli php7.2-xml php7.2-mysql

Check your available versions

update-alternatives --list php 

And switch to it

sudo update-alternatives --set php /usr/bin/php7.2

Everything is working now

4
sudo apt install software-properties-common

Then register the PPA

add-apt-repository ppa:ondrej/php

must install additional repository based on webseverfor nginx

add-apt-repository ppa:ondrej/nginx-mainline

for apache2

add-apt-repository ppa:ondrej/apache2

install your PHP packages

sudo apt-get install php7.2 php7.2-fpm php7.2-cli php7.2-xml php7.2-mysql

Check available versions

update-alternatives --list php 

switch to php7.2

sudo update-alternatives --set php /usr/bin/php7.2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy