package libapache2-mod-php7.2 7.2.5-0ubuntu0.18.04.1 failed to install/upgrade: installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1

Bug #1771934 reported by sunkaranam sai sri hari
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
php7.2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

unable to install the package

ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: libapache2-mod-php7.2 7.2.5-0ubuntu0.18.04.1
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
Date: Fri May 18 10:25:43 2018
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-xenial-amd64-20160624-2
ErrorMessage: installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2017-08-08 (282 days ago)
InstallationMedia: Ubuntu 16.04 "Xenial" - Build amd64 LIVE Binary 20160624-10:47
Python3Details: /usr/bin/python3.6, Python 3.6.5, python3-minimal, 3.6.5-3
PythonDetails: /usr/bin/python2.7, Python 2.7.15rc1, python-minimal, 2.7.15~rc1-1
RelatedPackageVersions:
 dpkg 1.19.0.5ubuntu2
 apt 1.6.1
SourcePackage: php7.2
Title: package libapache2-mod-php7.2 7.2.5-0ubuntu0.18.04.1 failed to install/upgrade: installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
UpgradeStatus: Upgraded to bionic on 2018-05-01 (17 days ago)
modified.conffile..etc.apache2.mods-available.php7.2.conf: [deleted]
modified.conffile..etc.apache2.mods-available.php7.2.load: [deleted]

Revision history for this message
sunkaranam sai sri hari (srihari52) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks for filing this bug in Ubuntu.

I'm seeing a bunch of errors like these, for several modules (zip, curl, others):
Setting up php7.2-zip (7.2.5-0ubuntu0.18.04.1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Not replacing deleted config file /etc/php/7.2/mods-available/zip.ini

And later it complains about not having the zip.ini file. Same for the other modules.

I can also see from your installation log that you tried to install, remove and purge apache, phpadmin, php7.2 and others multiple times.

What were you trying to install, just phpmyadmin? Maybe we can narrow it down to a simple test case.

Changed in php7.2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Mikael Setterberg (setterberg) wrote :

Hi,
I'm experiencing the same/similar issue when using the latest Puppet module puppetlabs-apache to install Apache2/PHP on the latest Bionic Beaver build.

What fails?
Executing: sudo apt-get install libapache2-mod-php7.2

Output:
.
.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php7.2 is already the newest version (7.2.5-0ubuntu0.18.04.1).
The following packages were automatically installed and are no longer required:
  libexpat1-dev libpython-all-dev libpython-dev libpython2.7 libpython2.7-dev python-all python2.7-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 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
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LC_CTYPE = "UTF-8",
 LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libapache2-mod-php7.2 (7.2.5-0ubuntu0.18.04.1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
apache2_switch_mpm prefork: No action required
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
.
.

Some more data points:
Trying to manually run the post installation script using "sudo sh -x ./libapache2-mod-php7.2.postinst configure 7.2" yields the output below:
.
.
+ check_switch=-m
+ invoke_string=module
+ rcd_action=restart
+ local a2query_ret=0
+ a2query -m php7.2
+ a2query_ret=1
+ [ 1 -eq 0 ]
+ [ 1 -eq 32 ]
+ APACHE2_NEED_ACTION=1
+ a2enmod -m -q php7.2
+ return 1
+ exit 1

Running "a2enmod php7.2" returns:
.
.
Considering dependency mpm_prefork for php7.2:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.2, aborting

Checking the puppet module code, there seems to have been a similar issue in 14.04 back in the day as someone hardcoded a fix there. See line 76: https://github.com/puppetlabs/puppetlabs-apache/blob/3bd70296be093a10713fd2f85676ac08d305e93f/manifests/mpm.pp

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

"sudo apt-get install libapache2-mod-php7.2" works just fine on a fresh bionic container, it even switches the mpm module:
(...)
Creating config file /etc/php/7.2/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.2
(...)

What about those locale errors? Here is mine, in that aforementioned bionic container where it all worked:
$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

Revision history for this message
Mikael Setterberg (setterberg) wrote :

The locale issues are due to me ssh:ing into the box, but setting the locale doesn't change anything (apart from the locale warnings going away that is).

Revision history for this message
Robie Basak (racb) wrote :

"the latest Puppet module puppetlabs-apache" isn't something shipped by Ubuntu. Can you figure out how to reproduce your problem on Ubuntu without it? If not, then why do you think the bug is in Ubuntu rather than in this puppet module?

Please provide exact steps to reproduce on a fresh Bionic VM or container using an official Ubuntu image. Once done, please change the bug status back to New.

Revision history for this message
Tim Bishop (tdb) wrote :

See bug #1782806 for what I think is the cause of this. It's a combination of a bug in the apache2 package, and different behaviour by the Puppet Apache module. Not a PHP issue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for php7.2 (Ubuntu) because there has been no activity for 60 days.]

Changed in php7.2 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The fix for bug #1782806 still needs to be pushed to bionic.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'm going to mark this as duplicate, thanks for the analysis @tdb

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.