diff --git a/debian/patches/0047-Disable-garbage-collection-routine.patch b/debian/patches/0047-Disable-garbage-collection-routine.patch new file mode 100644 index 0000000000000000000000000000000000000000..081e2b22d08baa0d217e9bfee8ffefb581f433f9 --- /dev/null +++ b/debian/patches/0047-Disable-garbage-collection-routine.patch @@ -0,0 +1,43 @@ +Description: Disable GC in ini files + This is disabled in the Debian packages due to the strict permissions on + /var/lib/php. Instead, GC is performed through /etc/cron.d/php, which uses the + session.gc_maxlifetime setting. +Author: Athos Ribeiro +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831752 +Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/php7.3/+bug/1772915 +Forwarded: not-needed +Last-Update: 2022-09-06 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/php.ini-development ++++ b/php.ini-development +@@ -1423,7 +1423,12 @@ + ; Development Value: 1 + ; Production Value: 1 + ; https://php.net/session.gc-probability +-session.gc_probability = 1 ++; Debian Default Value: 0 ++; This is disabled in the Debian packages due to the strict permissions ++; on /var/lib/php. Instead, GC is performed through /etc/cron.d/php, ++; which uses the session.gc_maxlifetime setting. Please, check ++; /usr/share/doc/php8.1-common/README.Debian.gz for further reference. ++session.gc_probability = 0 + + ; Defines the probability that the 'garbage collection' process is started on every + ; session initialization. The probability is calculated by using gc_probability/gc_divisor, +--- a/php.ini-production ++++ b/php.ini-production +@@ -1419,7 +1419,12 @@ + ; Development Value: 1 + ; Production Value: 1 + ; https://php.net/session.gc-probability +-session.gc_probability = 1 ++; Debian Default Value: 0 ++; This is disabled in the Debian packages due to the strict permissions ++; on /var/lib/php. Instead, GC is performed through /etc/cron.d/php, ++; which uses the session.gc_maxlifetime setting. Please, check ++; /usr/share/doc/php8.1-common/README.Debian.gz for further reference. ++session.gc_probability = 0 + + ; Defines the probability that the 'garbage collection' process is started on every + ; session initialization. The probability is calculated by using gc_probability/gc_divisor, diff --git a/debian/patches/series b/debian/patches/series index c1b03522fce449b41087fe7e05e760e643963119..794e109a8eb3cb593db4b49953fc698ef2eec737 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -44,3 +44,4 @@ 0044-Fail-the-build-when-the-dtrace-call-fails.patch 0045-Override-result-of-AC_PROG_LN_S-to-fix-FTBFS-on-ppc6.patch 0046-Update-gcc-func-attr-macro.patch +0047-Disable-garbage-collection-routine.patch diff --git a/debian/rules b/debian/rules index e2bcac1af2b4aba5faa9b0042c6cb5a220f82afc..092387f8ecc4d18c29d524317b4830c13d31d113 100755 --- a/debian/rules +++ b/debian/rules @@ -511,19 +511,16 @@ override_dh_install-arch: remove-files-stamp prepare-fpm-pools # sanitize php.ini files mkdir -p debian/$(PHP_COMMON)/usr/lib/php/$(PHP_NAME_VERSION)/ cat php.ini-production | tr "\t" " " | \ - $(SED) -e'/session.gc_probability =/ s/1/0/g;' \ - -e'/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' \ + $(SED) -e'/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' \ -e'/expose_php =/ s/On/Off/g;' \ > debian/$(PHP_COMMON)/usr/lib/php/$(PHP_NAME_VERSION)/php.ini-production cat php.ini-production | tr "\t" " " | \ $(SED) -e'/memory_limit =/ s/128M/-1/g;' \ - -e'/session.gc_probability =/ s/1/0/g' \ > debian/$(PHP_COMMON)/usr/lib/php/$(PHP_NAME_VERSION)/php.ini-production.cli cat php.ini-development | tr "\t" " " | \ - $(SED) -e'/session.gc_probability =/ s/1/0/g;' \ - -e'/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' \ + $(SED) -e'/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' \ > debian/$(PHP_COMMON)/usr/lib/php/$(PHP_NAME_VERSION)/php.ini-development ifeq (yes,$(RUN_TESTS))