Compare commits

...

8 Commits

12 changed files with 345 additions and 143 deletions

4
.gitignore vendored
View File

@@ -1,9 +1,13 @@
# - common
*.log
*.swp
*.bz2
conf/*.conf
/BAK/*
php-*
log_*
!php-5.6-libssl-1.1*
# Aber Patch-Dateien erlauben
!php-*.patch

View File

@@ -1,74 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Konfiguration
PHP_VERSION="5.6.40"
PHP_SRC="/usr/local/src/php/php-$PHP_VERSION"
ZLIB_PREFIX="/usr/local/zlib-1.2.11"
INSTALL_PREFIX="/usr/local/php56"
# 1. Quelle herunterladen
mkdir -p /usr/local/src/php
cd /usr/local/src/php
if [ ! -f "php-$PHP_VERSION.tar.bz2" ]; then
wget https://www.php.net/distributions/php-$PHP_VERSION.tar.bz2
fi
# 2. Entpacken
if [ ! -d "$PHP_SRC" ]; then
tar -xjf php-$PHP_VERSION.tar.bz2
fi
cd "$PHP_SRC"
# 3. Patches erstellen (Unix-LF)
cat > php56-fileinfo-fix.patch << 'EOF'
--- ext/fileinfo/libmagic/funcs.c
+++ ext/fileinfo/libmagic/funcs.c
@@ -439,7 +439,7 @@
-file_replace(struct magic_set *ms, const char *pat, const char *rep)
+void file_replace(struct magic_set *ms, const char *pat, const char *rep)
EOF
cat > php56-zlib-fix.patch << 'EOF'
--- ext/zlib/zlib.c
+++ ext/zlib/zlib.c
@@
-static void zm_globals_ctor_zlib(zend_zlib_globals *zlib_globals)
+static void zm_globals_ctor_zlib(void *zlib_globals)
+{
+ zend_zlib_globals *globals = (zend_zlib_globals *) zlib_globals;
+ globals->output_compression_default = 0;
+ globals->output_compression = 0;
+ globals->output_handler = NULL;
+}
EOF
cat > php56-mbfl-fix.patch << 'EOF'
--- ext/mbstring/libmbfl/mbfilter/mbfilter.c
+++ ext/mbstring/libmbfl/mbfilter/mbfilter.c
@@
-int mbfl_mbchar_bytes(int c)
+int mbfl_mbchar_bytes(unsigned int c)
EOF
# 4. Sicherstellen, dass Unix-Zeilenenden vorhanden sind
dos2unix php56-fileinfo-fix.patch
dos2unix php56-zlib-fix.patch
dos2unix php56-mbfl-fix.patch
# 5. Patches einspielen
patch -p0 < php56-fileinfo-fix.patch
patch -p0 < php56-zlib-fix.patch
patch -p0 < php56-mbfl-fix.patch
# 6. Configure & Build
make clean || true
./configure --prefix="$INSTALL_PREFIX" --with-zlib="$ZLIB_PREFIX" \
--enable-mbstring --with-openssl --enable-soap --enable-zip
make -j$(nproc)
make install
echo "PHP $PHP_VERSION wurde erfolgreich installiert in $INSTALL_PREFIX"
echo "Führe '$INSTALL_PREFIX/bin/php -v' aus, um die Version zu prüfen."

View File

@@ -114,33 +114,53 @@ is_int() {
return $(test "$@" -eq "$@" > /dev/null 2>&1);
}
detect_os_1 () {
if $(which lsb_release > /dev/null 2>&1) ; then
os_dist="$(lsb_release -i | awk '{print tolower($3)}')"
os_version="$(lsb_release -r | awk '{print tolower($2)}')"
os_codename="$(lsb_release -c | awk '{print tolower($2)}')"
if [[ "$os_dist" = "debian" ]]; then
if $(echo "$os_version" | grep -q '\.') ; then
os_version=$(echo "$os_version" | cut --delimiter='.' -f1)
fi
fi
elif [[ -e "/etc/os-release" ]]; then
detect_os_1() {
if [[ -r /etc/os-release ]]; then
. /etc/os-release
os_dist=$ID
os_version=${os_version_ID}
os_dist="$ID"
os_version="$VERSION_ID"
# Familie bestimmen
if [[ "$ID" == "debian" ]] || [[ "$ID_LIKE" == *"debian"* ]]; then
os_family="debian"
elif [[ "$ID" == "rhel" ]] || [[ "$ID_LIKE" == *"rhel"* ]]; then
os_family="rhel"
elif [[ "$ID" == "arch" ]] || [[ "$ID_LIKE" == *"arch"* ]]; then
os_family="arch"
else
os_family="$ID"
fi
elif which lsb_release > /dev/null 2>&1 ; then
local dist version
dist=$(lsb_release -is 2>/dev/null | tr '[:upper:]' '[:lower:]')
version=$(lsb_release -rs 2>/dev/null | cut -d. -f1) # Major Version
os_dist="$dist"
os_version="$version"
case "$dist" in
debian|ubuntu|linuxmint)
os_family="debian"
;;
rhel|centos|rocky|fedora)
os_family="rhel"
;;
arch)
os_family="arch"
;;
*)
os_family="$dist"
;;
esac
fi
# remove whitespace from os_dist and os_version
os_dist="${os_dist// /}"
os_version="${os_version// /}"
# Nur Major-Version extrahieren (z.B. 12 aus 12.5)
os_version=${os_version%%.*}
}
## ---
## --- END: functions
@@ -258,7 +278,7 @@ fi
# - Set variable
# - os_dist
# - os_version
# - os_codename
# - os_family
# -
detect_os_1
@@ -367,20 +387,15 @@ _required_base_packages="$_required_base_packages
vpx-tools"
# libcroco3-dev
# libc-client-dev is no longer available on debian 13
#
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 13 ]] ; then
_required_base_packages="$_required_base_packages
libc-client-dev"
fi
#
# Package libpcre3-dev is not availabl at debian 13, but libpcre2-dev is
# available there.
#
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 13 ]] ; then
if [[ "$os_dist" == "debian" ]] && (( os_version < 13 )); then
_required_base_packages="$_required_base_packages
libc-client-dev
libpcre3-dev"
else
_required_base_packages="$_required_base_packages
@@ -395,7 +410,7 @@ if [[ "$os_dist" != "ubuntu" ]] ; then
libgraphicsmagick++3"
fi
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 9 ]] ; then
if [[ "$os_dist" == "debian" ]] && (( os_version < 9 )); then
_required_base_packages="$_required_base_packages
libjasper-dev
libpng12-dev"
@@ -410,7 +425,8 @@ else
fi
fi
if [[ "$os_dist" = "debian" ]] && [[ $os_version -eq 7 ]] ; then
if [[ "$os_dist" == "debian" ]] && (( os_version == 7 )); then
_required_base_packages="$_required_base_packages
libgd2-xpm-dev
libdb5.1 libdb5.1++ libdb5.1++-dev libdb5.1-dev"
@@ -509,18 +525,86 @@ PHP_MAIN_VERSION=`echo $VERSION | cut -d '.' -f1,2`
declare -i PHP_MAJOR_VERSION=`echo $VERSION | cut -d '.' -f1`
declare -i PHP_MINOR_VERSION=`echo $VERSION | cut -d '.' -f2`
declare -i PHP_PATCH_LEVEL=`echo $VERSION | cut -d '.' -f3`
declare -i PHP_MAIN_VERSION_NUM=$((PHP_MAJOR_VERSION * 100 + PHP_MINOR_VERSION * 10))
declare -i PHP_VERSION_NUM=$((PHP_MAJOR_VERSION * 100 + PHP_MINOR_VERSION * 10 + PHP_PATCH_LEVEL))
#echo ""
#echo "PHP_MAIN_VERSION_NUM: $PHP_MAIN_VERSION_NUM"
#echo "PHP_VERSION_NUM: $PHP_VERSION_NUM"
#echo ""
# besser so:
#
# declare -i PHP_VERSION_NUM=$((10#$major * 10000 + 10#$minor * 100 + 10#$patch))
#
# '10#' verhindert Probleme mit führenden Nullen
#
# Bemerkung:
#
# um 2-stellige minor versionen korrekt zu behandeln, nehmen wir die major version * 10000
#
# versionen:
# 8.10.1
# 8.9.15
#
# mit 1000 ergibt sich
# 8.10.1 -> 8*1000 + 10*10 + 1 = 8101
# 8.9.15 -> 8*1000 + 9*10 + 15 = 8105
#
# 8101 < 8105 aber tatsächlich ist 8.10.1 > 8.9.15
#
# mit 10000 ergibt sich:
# 8.10.1 -> 8*10000 + 10*10 + 1 = 81001
# 8.9.15 -> 8*10000 + 9*10 + 15 = 80915
#
# 8101 < 8105 aber tatsächlich ist 8.10.1 > 8.9.15
# und damit (richtigerweise): 81001 > 80915
#
IFS='.' read -r major minor patch <<< "$VERSION"
declare -i PHP_VERSION_NUM=$((10#$major * 10000 + 10#$minor * 100 + 10#$patch))
declare -i PHP_MAIN_VERSION_NUM=$((10#$major * 10000 + 10#$minor * 100))
# =============================
# Version Helper Funktionen
# =============================
# ----------------------------
# Vollversion → numerische Zahl
# ----------------------------
version_to_number() {
local ver=${1:-$VERSION}
local a b c
IFS='.' read -r a b c <<< "$ver"
echo $((10#$a * 10000 + 10#$b * 100 + 10#${c:-0}))
}
# Vergleichsfunktionen für volle Versionen
version_eq() { local ref=$1; (( $(version_to_number "$VERSION") == $(version_to_number "$ref") )); }
version_lt() { local ref=$1; (( $(version_to_number "$VERSION") < $(version_to_number "$ref") )); }
version_le() { local ref=$1; (( $(version_to_number "$VERSION") <= $(version_to_number "$ref") )); }
version_gt() { local ref=$1; (( $(version_to_number "$VERSION") > $(version_to_number "$ref") )); }
version_ge() { local ref=$1; (( $(version_to_number "$VERSION") >= $(version_to_number "$ref") )); }
version_num() { version_to_number "${1:-$VERSION}"; }
# ----------------------------
# Main-Version → numerische Zahl (Major*100 + Minor)
# ----------------------------
main_version_to_number() {
local ver=${1:-$PHP_MAIN_VERSION}
IFS='.' read -r a b _ <<< "$ver"
echo $((10#$a * 100 + 10#$b))
}
# Vergleichsfunktionen für Main-Versionen
main_version_eq() { local ref=$1; (( $(main_version_to_number "$PHP_MAIN_VERSION") == $(main_version_to_number "$ref") )); }
main_version_lt() { local ref=$1; (( $(main_version_to_number "$PHP_MAIN_VERSION") < $(main_version_to_number "$ref") )); }
main_version_le() { local ref=$1; (( $(main_version_to_number "$PHP_MAIN_VERSION") <= $(main_version_to_number "$ref") )); }
main_version_gt() { local ref=$1; (( $(main_version_to_number "$PHP_MAIN_VERSION") > $(main_version_to_number "$ref") )); }
main_version_ge() { local ref=$1; (( $(main_version_to_number "$PHP_MAIN_VERSION") >= $(main_version_to_number "$ref") )); }
main_version_num() { main_version_to_number "${1:-$PHP_MAIN_VERSION}"; }
# Since version 7.4 package 'libsqlite3-dev' is needed
# Since version 7.4 package 'libonig-dev' is needed
#
if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -gt 3 ]]) \
|| [[ "$PHP_MAJOR_VERSION" -gt 7 ]] ; then
#if (( PHP_MAIN_VERSION_NUM >= 70400 )); then
if version_ge "7.4.0"; then
needed_debian_packages="$needed_debian_packages
libsqlite3-dev
libonig-dev"
@@ -528,19 +612,21 @@ fi
# - A hack, because configure don't work with systemd on version 5.4.x
## -
if [[ "$PHP_MAIN_VERSION" = "5.4" ]]; then
#if (( PHP_MAIN_VERSION_NUM == 50400 )) ; then
if main_version_eq "5.4"; then
SYSTEMD_EXISTS=false
fi
## - Let make use multiple cores (-j<number of cores +1>)
## -
if [[ "$PHP_MAIN_VERSION" != "5.4" ]]; then
if ! main_version_eq "5.4"; then
export MAKEFLAGS=-j$(expr `grep "^processor" /proc/cpuinfo | sort -u | wc -l` + 1)
else
unset MAKEFLAGS
fi
if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 12 ]]; then
if main_version_eq "5.6" &&
(( os_version >= 13 )) &&
[[ "$os_dist" == "debian" ]] ; then
warn "For php version 5.6 at debian 13 and above, you need manual installation of
@@ -555,16 +641,20 @@ if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 12 ]]; then
\t cyrus-sasl compiled against openssl 1.1
\t openldap compiled against cyrus-sasl"
elif [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 11 ]]; then
elif main_version_eq "5.6" &&
(( os_version >= 12 )) &&
[[ "$os_dist" == "debian" ]] ; then
warn "For php version 5.6 at debian 12 and above, you need manual installation of
\t freetype (libfreetype6-dev)
\t libxml2
\t icu4c (libicu)
\t openssl v 1.1.1 "
\t openssl v 1.1.1"
elif [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 9 ]]; then
elif main_version_eq "5.6" &&
(( os_version >= 10 )) &&
[[ "$os_dist" == "debian" ]] ; then
warn "For php version 5.6 at debian 10 and above, you need manual installation of
@@ -5917,7 +6007,7 @@ fi
_patch_file="php-5.6-zlib-1.2.11.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -5958,7 +6048,7 @@ fi
_patch_file="php-5.6-libmagic.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -5999,7 +6089,7 @@ fi
_patch_file="php-5.6-mbfl_encoding.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6040,7 +6130,7 @@ fi
_patch_file="php-5.6-mbfl_put_invalid_char.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6081,7 +6171,7 @@ fi
_patch_file="php-5.6-session.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6122,7 +6212,7 @@ fi
_patch_file="php-5.6-wddx.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6163,7 +6253,7 @@ fi
_patch_file="php-5.6-mkstemp.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6204,7 +6294,7 @@ fi
_patch_file="php-5.6-reentrancy.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6245,7 +6335,7 @@ fi
_patch_file="php-5.6-cast.patch"
echononl "\tApply ${_patch_file}"
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -6299,8 +6389,6 @@ if ! $WITHOUT_APACHE_MOD_PHP ; then
fi
cd $_builddir || exit 1
echononl "\tGoing to configure.."
# : ${_arch:=i686}
# : ${_arch:=athlon}
# : ${_arch:=k8} ## --> x86-64 instructionset
@@ -6315,7 +6403,7 @@ echononl "\tGoing to configure.."
## CPP="/usr/bin/cpp-3.4" \
## CFLAGS="$_cflags" LDFLAGS="-s" \
#if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
#if main_version_le "7.3" && (( os_version >= 13 )); then
# export CFLAGS="-O2 -fno-strict-aliasing -Wno-error=incompatible-pointer-types"
#fi
if $_install_openldap ; then
@@ -6325,6 +6413,32 @@ if $_install_openldap ; then
-L/usr/local/cyrus-sasl/lib -Wl,-rpath,/usr/local/cyrus-sasl/lib \
-L/usr/local/openssl/lib -Wl,-rpath,/usr/local/openssl/lib"
fi
if main_version_eq "7.4" ; then
export CXXFLAGS="-O2 -pipe -std=gnu++17"
export CFLAGS="-O2 -pipe"
fi
if main_version_eq "8.0" ; then
# cp -a build/php_cxx_compile_stdcxx.m4 build/php_cxx_compile_stdcxx.m4.ORIG
#
#sed -i 's/-std=c++11/-std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
#sed -i 's/-std=gnu++11/-std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
#sed -i 's/-std=c++14/-std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
#sed -i 's/-std=gnu++14/-std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
#sed -i 's/-std=c++0x/-std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
#
# #sed -i 's/std=c++11/std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
# #sed -i 's/std=gnu++11/std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
# #sed -i 's/std=c++0x/std=gnu++17/g' build/php_cxx_compile_stdcxx.m4
# echo ""
# ./buildconf --force
# echo ""
# echo ""
#
export CC=gcc
export CXX=g++
export CXXFLAGS="-O2 -pipe -std=gnu++17"
export ICU_CXXFLAGS="-std=gnu++17"
fi
config_params="
--prefix=$PREFIX_PHP
@@ -6356,7 +6470,6 @@ config_params="
--with-xsl
--with-mhash
--enable-cgi
--with-ldap=shared
--with-xmlrpc"
@@ -6402,7 +6515,7 @@ else
--with-curl"
fi
if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then
if main_version_le "7.3" && (( os_version >= 13 )); then
if $_install_openldap ; then
config_params="${config_params}
--with-ldap"
@@ -6416,9 +6529,29 @@ fi
#if ([[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \
# || [[ "$PHP_MAJOR_VERSION" -lt 8 ]] ; then
if [[ "$os_dist" = "debian" ]] && [[ "$os_version" -lt 13 ]] \
&& ( [[ "$PHP_MAJOR_VERSION" -lt 8 ]] \
|| ( [[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]] ) ) ; then
#if [[ "$os_dist" = "debian" ]] && [[ "$os_version" -lt 13 ]] \
# && ( [[ "$PHP_MAJOR_VERSION" -lt 8 ]] \
# || ( [[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]] ) ) ; then
#
# config_params="$config_params
# --with-imap
# --with-imap-ssl
#"
#fi
#if [[ "$os_family" == "debian" ]] && (( os_version < 13 )) && main_version_lt "8.4"; then
#
# config_params="$config_params
# --with-imap
# --with-imap-ssl
#"
#fi
if main_version_le "8.3" && \
( dpkg -s libc-client-dev >/dev/null 2>&1 \
|| dpkg -s libc-client2007e-dev >/dev/null 2>&1 \
|| dpkg -s libc-client2007f-dev >/dev/null 2>&1 \
|| dpkg -s uw-imap-dev >/dev/null 2>&1 ); then
config_params="$config_params
--with-imap
@@ -6554,6 +6687,9 @@ if $WITH_PHP_FPM_SUPPORT ; then
config_params="$config_params --enable-fpm"
fi
echononl "\tGoing to configure.."
echo "LDFLAGS=\"-s\" ./configure $config_params" > ${_logdir}/php-configure.log
echo "" >> ${_logdir}/php-configure.log
@@ -6777,7 +6913,7 @@ if [ -f /etc/manpath.config ];then
echo "MANPATH_MAP /usr/local/php/bin /usr/local/php/php/man" >> /etc/manpath.config
echo "MANDB_MAP /usr/local/php/php/man /var/cache/man" >> /etc/manpath.config
fi
elif [ -f /etc/man.conf];then
elif [ -f /etc/man.conf ]; then
if ! grep /opt/php/man /etc/man.conf > /dev/null 2<&1 ; then
echo >> /etc/man.conf
echo "MANPATH /opt/php/man /var/cache/man" >> /etc/man.conf
@@ -9305,9 +9441,9 @@ echo "" >> ${_logdir}/pecl_install.log
echononl "\tInstall 'imap' via pecl.."
if ([[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \
|| [[ "$PHP_MAJOR_VERSION" -gt 8 ]] \
|| ([[ "$os_dist" = "debian" ]] && [[ "$os_version" -ge 13 ]]) ; then
#if main_version_ge "8.3" && \
# ( main_version_ge "8.4" || ([[ "$os_family" == "debian" ]] && (( os_version >= 13 ))) ); then
if main_version_ge "8.4" ; then
if dpkg -s libc-client-dev > /dev/null 2>&1 \
|| dpkg -s libc-client2007e-dev > /dev/null 2>&1 \
@@ -9316,7 +9452,7 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \
export CPPFLAGS="-I/usr/include"
export LDFLAGS="-L/usr/lib"
printf "no\nyes\n" | pecl install imap >> "${_logdir}/pecl_install.log" 2>&1
printf "no\nyes\n" | ${PREFIX_PHP}/bin/pecl install imap >> "${_logdir}/pecl_install.log" 2>&1
if [ "$?" = "0" ]; then
echo_ok
@@ -10837,6 +10973,10 @@ if [[ -n "$zend_extension_opcache" ]];then
echo_failed
fi
fi
if [[ -n "$zend_extension_opcache" ]] || main_version_ge "8.5" ; then
## - set opcache.error_log="/var/log/apache2/
## -
echononl "\tphp.ini: opcache.error_log = /var/log/apache2/opcache_errors.log"

21
php-5.6-cast.patch Normal file
View File

@@ -0,0 +1,21 @@
--- main/streams/cast.c.bak 2026-03-03 21:01:49.742036485 +0100
+++ main/streams/cast.c 2026-03-03 21:10:36.519494693 +0100
@@ -122,11 +122,16 @@
return 0;
}
# else
-static int stream_cookie_seeker(void *cookie, off_t position, int whence)
+static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence)
{
TSRMLS_FETCH();
- return php_stream_seek((php_stream *)cookie, position, whence);
+ *position = php_stream_seek((php_stream *)cookie, (off_t)*position, whence);
+
+ if (*position == -1) {
+ return -1;
+ }
+ return 0;
}
# endif

10
php-5.6-libmagic.patch Normal file
View File

@@ -0,0 +1,10 @@
--- ext/fileinfo/libmagic/funcs.c.bak 2019-01-09 10:54:13.000000000 +0100
+++ ext/fileinfo/libmagic/funcs.c 2026-03-03 18:05:18.222386324 +0100
@@ -437,6 +437,7 @@
return ms->o.buf == NULL ? 0 : strlen(ms->o.buf);
}
+protected int
file_replace(struct magic_set *ms, const char *pat, const char *rep)
{
zval *patt;

View File

@@ -0,0 +1,11 @@
--- ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c.bak 2026-03-03 18:35:51.943832964 +0100
+++ ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 2026-03-03 18:36:08.663776701 +0100
@@ -48,7 +48,7 @@
mbfl_no_encoding_2022jp_kddi,
"ISO-2022-JP-MOBILE#KDDI",
"ISO-2022-JP",
- mbfl_encoding_2022jp_kddi_aliases,
+ &mbfl_encoding_2022jp_kddi_aliases,
NULL,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
};

View File

@@ -0,0 +1,11 @@
--- ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c.bak 2019-01-09 10:54:13.000000000 +0100
+++ ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2026-03-03 18:51:24.912344206 +0100
@@ -36,6 +36,8 @@
#include "mbfilter_utf8_mobile.h"
#include "mbfilter_sjis_mobile.h"
+int mbfl_filt_put_invalid_char(int c, mbfl_convert_filter *filter);
+
extern int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter);
extern int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter);

10
php-5.6-mkstemp.patch Normal file
View File

@@ -0,0 +1,10 @@
--- ext/zip/lib/mkstemp.c.bak 2019-01-09 10:54:13.000000000 +0100
+++ ext/zip/lib/mkstemp.c 2026-03-03 19:48:02.521698567 +0100
@@ -43,6 +43,7 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#ifndef O_BINARY
#define O_BINARY 0

11
php-5.6-reentrancy.patch Normal file
View File

@@ -0,0 +1,11 @@
--- main/reentrancy.c.bak 2026-03-03 20:45:56.822721495 +0100
+++ main/reentrancy.c 2026-03-03 20:46:22.066607624 +0100
@@ -136,7 +136,7 @@
(HPUX returns 0 on success whereas Solaris returns non-zero)
*/
entry->d_name[0] = '\0';
- readdir_r(dirp, entry);
+ readdir_r(dirp, entry, result);
if (entry->d_name[0] == '\0') {
*result = NULL;

20
php-5.6-session.patch Normal file
View File

@@ -0,0 +1,20 @@
--- ext/session/session.c.bak 2019-01-09 10:54:13.000000000 +0100
+++ ext/session/session.c 2026-03-03 19:11:58.987141885 +0100
@@ -859,12 +859,16 @@
PS_SERIALIZER_DECODE_FUNC(php_serialize) /* {{{ */
{
const char *endptr = val + vallen;
+ const unsigned char *p;
+ const unsigned char *max;
zval *session_vars;
php_unserialize_data_t var_hash;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
ALLOC_INIT_ZVAL(session_vars);
- if (php_var_unserialize(&session_vars, &val, endptr, &var_hash TSRMLS_CC)) {
+ p = (const unsigned char *) val;
+ max = (const unsigned char *) endptr;
+ if (php_var_unserialize(&session_vars, &p, max, &var_hash TSRMLS_CC)) {
var_push_dtor(&var_hash, &session_vars);
}

11
php-5.6-wddx.patch Normal file
View File

@@ -0,0 +1,11 @@
--- ext/wddx/wddx.c.bak 2026-03-03 19:30:38.762247898 +0100
+++ ext/wddx/wddx.c 2026-03-03 19:26:11.139426331 +0100
@@ -467,7 +467,7 @@
/* OBJECTS_FIXME */
zval **ent, *fname, **varname;
zval *retval = NULL;
- const char *key;
+ char *key;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;

27
php-5.6-zlib-1.2.11.patch Normal file
View File

@@ -0,0 +1,27 @@
--- ext/zlib/zlib.c.bak 2019-01-09 10:54:13.000000000 +0100
+++ ext/zlib/zlib.c 2026-03-03 17:34:11.078246063 +0100
@@ -1013,10 +1013,12 @@
/* }}} */
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
-static ZEND_MODULE_GLOBALS_CTOR_D(zlib)
+static void php_zlib_globals_ctor(void *zlib_globals)
{
- zlib_globals->ob_gzhandler = NULL;
- zlib_globals->handler_registered = 0;
+ zend_zlib_globals *g = (zend_zlib_globals *) zlib_globals;
+
+ g->ob_gzhandler = NULL;
+ g->handler_registered = 0;
}
/* }}} */
@@ -1032,7 +1034,7 @@
PHP_MINFO(zlib),
"2.0",
PHP_MODULE_GLOBALS(zlib),
- ZEND_MODULE_GLOBALS_CTOR_N(zlib),
+ php_zlib_globals_ctor,
NULL,
NULL,
STANDARD_MODULE_PROPERTIES_EX