Search code examples
dockerubuntu-16.04php-7

install php7.4 on ubuntu 16.04 - Dockerfile


I am trying to install php7.4 and related packages with below commands

FROM ubuntu:16.04
RUN apt update \
    && apt install -y software-properties-common\
    && add-apt-repository ppa:ondrej/php \
    && apt-get update \
    && apt-get install -y php7.4

I get the below message

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'

on searching with

apt-cache search php7

I see that only 7.0 related packages are available

php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP

I am confused why I am not getting the newer versions as 7.3, 7,4 and 8 should be the only ones available today. How can I get php7.4 packages?


Solution

  • TL;DR: Since Ubuntu 16.04 reached "End of Standard Support", packages for it were removed from the PPA.


    You might want to read this: https://github.com/oerdnj/deb.sury.org/issues/1567

    In April 2021, Ubuntu 16.04 Xenial will reach End of Standard Support and will be available only as a paid option through Ubuntu Extended Security Maintenance.

    What does it mean for DEB.SURY.ORG PPAs?

    • The packages for Ubuntu 16.04 will be deleted shortly after the EoL/EoSS is announced, usually at the same time as the next PHP release is published because it's not possible to build the packages any more.

    • The packages for Ubuntu 16.04 will be available via PHP LTS by Freexian paid program. This is cheaper option than previously announced Private dedicated repositories.