[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#827446: libapache2-mod-php5: postinst script changes MPM back to prefork, even with updates



I would like to add a work-around for this issue, which was brought to me by someone else (but I cant find the mail any more, so I cant give credits).

In the file /var/lib/dpkg/info/libapache2-mod-php5.postinst the following code is used:

    php5_enable() {
PHP_MODULE=$(a2query -m | sed -n 's/^\(php[\.0-9]*\) (enabled.*)/\1/p')
        if [ -n "$PHP_MODULE" -a "$PHP_MODULE" != "php5" ]; then
apache2_msg err "ERROR: $PHP_MODULE module already enabled, not enabling php5"
            return 1
        fi

        mpm=$(a2query -M)
        case "$(a2query -M)" in
            prefork|itk) return 0;;
            *) if apache2_switch_mpm prefork; then return 0; fi;;
        esac
apache2_msg err "Could not switch to prefork MPM, not enabling php5"
        return 1
    }

This causes the script to return if a a module called php[0-9] is found. If so, it does not change the MPM.

So, if we create /etc/apache2/mods-available/php0.conf and php0.load, and enable this module using a2enmod, the postinst script no longer changes the MPM.

--
Regards,
Rudy Broersma
Exsilia Internet BV


Reply to: