-1

Trying to install php7.4-dev extension, but I'm getting

E: Unable to locate package php7.4-dev
E: Couldn't find any package by glob 'php7.4-dev'
E: Couldn't find any package by regex 'php7.4-dev'

When I run apt show php it displays the following:

Package: php
Version: 1:7.2+60ubuntu1
Priority: optional
Section: php
Source: php-defaults (60ubuntu1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 12.3 kB
Depends: php7.2
Supported: 5y
Download-Size: 3,084 B
APT-Sources: http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: server-side, HTML-embedded scripting language (default)
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.
 .
 This package is a dependency package, which depends on Ubuntu's default
 PHP version (currently 7.2).

I used the following commands to update the repository.

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

After running apt show php again, I received the same message as before, and the version remains unchanged, still showing PHP 7.2.

However, I consistently encounter the same result every time, and unfortunately, I'm unable to install php7.4-dev.

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

IMSoP
  • 89,526
  • 13
  • 117
  • 169
  • 1
    Does this answer your question? [php8.2 in ubuntu 18.04 : E: Unable to locate package php8.2](https://stackoverflow.com/questions/76864353/php8-2-in-ubuntu-18-04-e-unable-to-locate-package-php8-2) – IMSoP Aug 14 '23 at 10:15

1 Answers1

0

I was facing the same issue somehow ppa:ondrej/php is not working on Ubuntu 18.04. As mentioned in this article after adding following repositories I was able to install php7.4

sudo add-apt-repository ppa:sergey-dryabzhinsky/php74
sudo add-apt-repository ppa:sergey-dryabzhinsky/php7-modules
sudo add-apt-repository ppa:sergey-dryabzhinsky/backports
sudo add-apt-repository ppa:sergey-dryabzhinsky/packages
Rehan Haider
  • 893
  • 11
  • 26
  • 2
    PHP 7.4 not owrking in Ubuntu 18.04 when using the ppa:ondrej/php repository is because both of these are end of life and the repository maintainer only provides support for PHP and Ubuntu versions that are within support. – apokryfos Aug 03 '23 at 15:07