5

I am running Ubuntu 17.04 with PHP 7.1, I am trying to install the PHP dev extension but it isn't found:

[17:21:43] @Z240:~/workspace/api$ sudo apt install php7.1-dev
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
E: Impossible de trouver le paquet php7.1-dev
E: Couldn't find any package by glob 'php7.1-dev'
E: Impossible de trouver de paquet correspondant à l'expression rationnelle « php7.1-dev »

Here is the list of installed installed extensions:

[17:21:42] @Z240:~/workspace/api$ sudo apt-cache pkgnames | grep php7.1
php7.1-xml
php7.1-mbstring
php7.1-readline
php7.1-zip
php7.1-mysql
php7.1
php7.1-sqlite3
php7.1-opcache
php7.1-json
php7.1-curl
php7.1-ldap
php7.1-bz2
php7.1-cli
php7.1-common
php7.1-mcrypt
php7.1-gd

I don't understand why it isn't available. It should be part of the default packages.

[Edit] Weird: when trying to install phpize, apt-get suggest me to install php7.0-dev even I use 7.1:

[17:33:12] @Z240:~/workspace/api$ php -v PHP 7.1.11-1+ubuntu17.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:50:28) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.11-1+ubuntu17.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.2~linux-x64-non_zts71, https://blackfire.io, by SensioLabs

[17:33:22] @Z240:~/workspace/api$ phpize Le programme « phpize » n'est pas encore installé. Vous pouvez l'installer en tapant : sudo apt install php7.0-dev

1
  • This was actually the good answer because the maintenance period for 17.04 was over and nothing couldn't be installed any-more.
    – COil
    Jul 31, 2018 at 12:13

2 Answers 2

9
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-dev

This is tested and It works perfectly

3
  • 3 first steps are OK, but on the last I get: "Impossible de trouver le paquet php7.1-dev" : "impossible to find the php7.1-dev packet". So me I have a configuration problem elsewhere.
    – COil
    Mar 2, 2018 at 13:07
  • Php installation and configuration may be incorrect.Please uninstall php by (sudo apt-get purge php7.*) and install it again (sudo apt-get install php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm) Mar 2, 2018 at 13:15
  • 1
    giving this E: Unable to locate package php7.1-dev Jul 12, 2019 at 6:38
0

Try adding Ondřej Surý PPA, it has the latest PHP updates and packages

sudo add-apt-repository ppa:ondrej/php

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .