Description
There is an issue when using Plesk on Debian/Ubuntu machines and Apache running in mpm event (instead of the more commonly used mpm prefork). When there are updates to PHP delivered by the Debian package maintainers the libapache2-mod-php5 is also updated. This causes the libapache2-mod-php5.postinst script to run.
This script restores the Apache MPM back to prefork, even though MPM Event is configured. This is caused by /var/lib/dpkg/info/libapache2-mod-php5.postinst line 15 to 21:
My initial idea to resolve this issue is to simply uninstall package libapache2-mod-php5. However, this is impossible because Plesk depends on it:
I believe this is a bug in Plesk, because Plesk should not depend on this package because it is perfectly possible (and getting more and more common) to run PHP as (F)CGI or FPM instead of the Apache module.
Version
CPU Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz (4 core(s))
Version Plesk v12.5.30_build1205150826.19 os_Debian 8.0
OS Debian 8.5
How to reproduce?
Expected result:
The Apache MPM should not change. I believe this is a bug in Plesk because:
Actual result:
The Apache MPM is changed back to prefork when installing PHP updates.
Fix
None
A temporary fix is to hold back updates for this package, but that is not ideal.
There is an issue when using Plesk on Debian/Ubuntu machines and Apache running in mpm event (instead of the more commonly used mpm prefork). When there are updates to PHP delivered by the Debian package maintainers the libapache2-mod-php5 is also updated. This causes the libapache2-mod-php5.postinst script to run.
This script restores the Apache MPM back to prefork, even though MPM Event is configured. This is caused by /var/lib/dpkg/info/libapache2-mod-php5.postinst line 15 to 21:
Code:
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
My initial idea to resolve this issue is to simply uninstall package libapache2-mod-php5. However, this is impossible because Plesk depends on it:
Code:
# apt-get remove libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libapache2-mod-php5 psa-php5-configurator psa-phpfpm-configurator
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 10.1 MB disk space will be freed.
Do you want to continue? [Y/n]
I believe this is a bug in Plesk, because Plesk should not depend on this package because it is perfectly possible (and getting more and more common) to run PHP as (F)CGI or FPM instead of the Apache module.
Version
CPU Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz (4 core(s))
Version Plesk v12.5.30_build1205150826.19 os_Debian 8.0
OS Debian 8.5
How to reproduce?
- Run Apache in mpm_event
- Wait for a PHP update from Debian, install the update (or manually run the postinst script)
- Notice you are now running mpm_prefork instead of mpm_event
Expected result:
The Apache MPM should not change. I believe this is a bug in Plesk because:
- The whole idea of libapache2-mod-php5 is to install the PHP5 module in Apache. So I think it is logical that the postinst script for this package changes the mpm to a mpm that is capable of running PHP.
- I therefor believe this is not an issue in the postinst scripts for this package.
- There is no reason for Plesk to depend on libapache2-mod-php5 when the server is running in mpm_event and has the PHP5 module disabled.
- Thus, Plesk should not depend on this package.
Actual result:
The Apache MPM is changed back to prefork when installing PHP updates.
Fix
None
A temporary fix is to hold back updates for this package, but that is not ideal.