Control: tag -1 + patch
2016-04-17 13:51 GMT+02:00 Mathieu Parent (Debian) <sath...@debian.org>: > 2016-04-07 23:05 GMT+02:00 Mathieu Parent (Debian) <sath...@debian.org>: Here is an updated version: > Please consider the atatched patches.I've tested that they work if: > - only php7.0-fpm is installed > - only libapache2-mod-php7.0 is installed > - both are installed > > Notes: > - if both are installed, -fpm wins now, mod_php wins > - if apache2 is installed after -fpm, -fpm is not activated still. But this not worse than currently. Cheers -- Mathieu Parent
From 669898d1ecac4329c57d38dd1ab28a83f34515bb Mon Sep 17 00:00:00 2001 From: Mathieu Parent <math.par...@gmail.com> Date: Sun, 17 Apr 2016 03:54:15 +0200 Subject: [PATCH 3/3] Enable mod_proxy_fcgi for php-fpm --- debian/php-fpm.postinst.extra | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/php-fpm.postinst.extra b/debian/php-fpm.postinst.extra index 9394363..5895ce9 100644 --- a/debian/php-fpm.postinst.extra +++ b/debian/php-fpm.postinst.extra @@ -3,6 +3,7 @@ if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then php_enable() { # Enable PHP FPM by default when Apache 2 is installed + apache2_invoke enmod proxy_fcgi return 0 } else -- 2.8.0.rc3
From 121144164aef76a6cf6fdd9a34ba8a2ea2cb1664 Mon Sep 17 00:00:00 2001 From: Mathieu Parent <math.par...@gmail.com> Date: Thu, 7 Apr 2016 22:57:41 +0200 Subject: [PATCH 2/3] Only use fpm SetHandler when it works i.e when mod_proxy_fcgi is loaded --- debian/php-fpm.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/php-fpm.conf b/debian/php-fpm.conf index 32c1119..8487808 100644 --- a/debian/php-fpm.conf +++ b/debian/php-fpm.conf @@ -1,5 +1,6 @@ # Redirect to local php-fpm if mod_php is not available <IfModule !mod_php@PHP_MAJOR@.c> +<IfModule proxy_fcgi_module> # Enable http authorization headers SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 @@ -17,3 +18,4 @@ Require all denied </FilesMatch> </IfModule> +</IfModule> -- 2.8.0.rc3
From 44b95cfce8a7627fb765dcf652a4713aa566f044 Mon Sep 17 00:00:00 2001 From: Mathieu Parent <math.par...@gmail.com> Date: Sun, 17 Apr 2016 03:42:02 +0200 Subject: [PATCH 1/3] Revert "Don't enable PHP FPM by default" This reverts commit 4c4736beed2d0151d69aadbfc156a9d9b3df05c1. --- debian/php-fpm.postinst.extra | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/php-fpm.postinst.extra b/debian/php-fpm.postinst.extra index 9e017b3..9394363 100644 --- a/debian/php-fpm.postinst.extra +++ b/debian/php-fpm.postinst.extra @@ -1,7 +1,16 @@ -php_enable() { - # Don't enable PHP FPM by default - return 1 -} +if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + . /usr/share/apache2/apache2-maintscript-helper + + php_enable() { + # Enable PHP FPM by default when Apache 2 is installed + return 0 + } +else + php_enable() { + # Don't enable PHP FPM by default when Apache 2 is not installed + return 1 + } +fi if [ "$1" = "triggered" ] && [ "$2" = "/etc/php/@PHP_VERSION@/fpm/conf.d" ]; then invoke-rc.d php@PHP_VERSION@-fpm restart -- 2.8.0.rc3