Comment 3 for bug 1771934

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