[php-maint] Bug#720278: libapache2-mod-php5 disables mpm_itk

Craig Sanders cas at taz.net.au
Tue Aug 20 02:15:46 UTC 2013

Package: libapache2-mod-php5
Version: 5.5.1+dfsg-2

ever since I upgraded to apache 2.4 a few months ago, something has
been disabling mpm_itk and replacing it with mpm_prefork when i run
apt-get dist-upgrade, breaking my apache config until I manually disable
mpm_prefork and re-enable mpm_itk with:

    a2dismod mpm_prefork mpm_event mpm_worker
    a2enmod mpm_itk

(i've done that so often now, that i have a tiny script to do it called

i finally figured out today that the culprit is libapache2-mod-php5,
specifically this function in the postinst script:

    php5_enable() {
        if [ $(a2query -M) != 'prefork' ] ; then
            if apache2_switch_mpm prefork ; then
                return 0
                apache2_msg err "Could not switch to prefork MPM, not enabling php5"
                return 1
        return 0

this is broken. 

mpm_itk works with php5 just as well as mpm_prefork does. in fact,
mpm_itk is a specialised version of mpm_prefork that lets you run
virtual hosts (and their cgi & php scripts etc) under a specific uid &

a simple fix would be to replace:

        if [ $(a2query -M) != 'prefork' ] ; then


        if [ $(a2query -M) != 'prefork' ] && [ $(a2query -M) != 'itk' ] ; then


craig sanders <cas at taz.net.au>

More information about the pkg-php-maint mailing list