web-dev-qa-db-fra.com

Obtenir des erreurs lors de l'installation de php sur Ubuntu 16.04

Commande: Sudo apt-get install php7.0

Sortie:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.0 is already the newest version (7.0.8-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.1) ...
Error: The new file /usr/lib/php/7.0/php.ini-production does not exist!
dpkg: error processing package libapache2-mod-php7.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-php7.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

Lors de l'installation de libapache2-mod-php7.0

Commande: Sudo apt-get install libapache2-mod-php7.0

Sortie:

 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 libapache2-mod-php7.0 is already the newest version (7.0.8-0ubuntu0.16.04.1).
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 1 not fully installed or removed.
 After this operation, 0 B of additional disk space will be used.
 Do you want to continue? [Y/n] Y
 Setting up libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.1) ...
 Error: The new file /usr/lib/php/7.0/php.ini-production does not exist!
 dpkg: error processing package libapache2-mod-php7.0 (--configure):
  subprocess installed post-installation script returned error exit status 1
 Errors were encountered while processing:
  libapache2-mod-php7.0
 E: Sub-process /usr/bin/dpkg returned an error code (1)

Comment résoudre ce problème.

5
G S P

Exécutez les commandes suivantes:

Sudo apt-get update
Sudo apt-get install --reinstall php7.0-common

Si cela ne fonctionne pas, exécutez les commandes suivantes:

mkdir PHP
cd PHP
apt-get download php7.0-common
ar -xvf *
tar -xvf dat*
Sudo mv ./usr/lib/php/7.0/php.ini-production /usr/lib/php/7.0/php.ini-production
Sudo apt-get -f install
3
mchid