Command: sudo apt-get install php7.0

Output:

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)

While installing libapache2-mod-php7.0

Command: sudo apt-get install libapache2-mod-php7.0

Output:

 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)

How to resolve this problem.

share|improve this question
    
Hey. Just a tip to help you out in the future, you can install apt-file: sudo apt-get install apt-file then run: sudo apt-file update and when you encounter a file such and such is not found like this one, you can find out what package provides a file by running a search for the file like so: sudo apt-file search /usr/lib/php/7.0/php.ini-production or sudo apt-file search php.ini-production – mchid Jul 27 '16 at 11:28
up vote 1 down vote accepted

Run the following commands:

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

If that doesn't work, run the following commands:

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.