Page MenuHomePhabricator

httpd class and php7.0 - conflict with mpm_event module
Closed, ResolvedPublic

Description

on a freshly reinstalled icinga1001:

Notice: /Stage[main]/Httpd/Httpd::Mod_conf[php7.0]/Exec[ensure_present_mod_php7.0]/returns: ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!

Error: /usr/sbin/a2enmod php7.0 returned 1 instead of one of [0]

a2enmod php7.0
Considering dependency mpm_prefork for php7.0:
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:

This was easily fixed by:

a2dismod mpm_event
Module mpm_event disabled.

a2enmod php7.0
..
Enabling module php7.0.

But it should not happen because Puppet already has code for this:

# Disable the other mpms, enable the selected one.
$rejected_mpms = prefix(reject($available_mpms, $mpm), 'mpm_')
httpd::mod_conf { $rejected_mpms:
    ensure => absent,
}

in /modules/httpd/manifests/mpm.pp

So something there doesn't work as it should.

Event Timeline

Dzahn added a subscriber: Joe.

Nevermind, exact same issue already described in role::webperf::profiling_tools

# class httpd installs mpm_event by default, and once installed,
# it cannot easily be uninstalled. The xhgui profile installs
# libapache2-mod-php7.0 which in turn installs mpm_prefork, which
# fails if mpm_event is present. (T180761)
class { '::httpd::mpm':
    mpm => 'prefork'
}

Change 470106 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] icinga/alerting_host: ensure mpm_prefork is selected for httpd and php7.0

https://gerrit.wikimedia.org/r/470106

Change 470106 merged by Dzahn:
[operations/puppet@production] icinga/alerting_host: ensure mpm_prefork is selected for httpd and php7.0

https://gerrit.wikimedia.org/r/470106

I think we should stop using mod_php *anywhere*. We should really use php-fpm for anything that is not explicitly known not to work with fcgi (and I wonder, what that might be).

So for LAMP applications we might want to create a simple profile that installs:

  • httpd
  • php-fpm using the php module
  • The entrypoint in the application if needed

And use it for all of them minus MediaWiki.

I think we should stop using mod_php *anywhere*. We should really use php-fpm for anything that is not explicitly known not to work with fcgi (and I wonder, what that might be).

+1 for php-fpm, it's a much better solution in my experience.