From ab89dd9752d5ba0e9fbc257ba201b31d3aefa567 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Tue, 17 Dec 2024 14:35:23 -0500 Subject: [PATCH] * Tue Dec 17 2024 Jean-Philippe Pialasse 11.0.0-12.sme - add php84 support [SME: 12805] - set php84 as default and php83 as base php as defined by module - set new value for serialize_precision [SME: 12430] --- .../templates/etc/php-fpm.d/custom.conf/10All | 29 +++++++-------- .../templates/etc/php.ini/10LanguageOptions | 5 ++- .../etc/php.ini/80ModuleSettings16Session | 6 ++-- .../usr/share/perl5/vendor_perl/esmith/php.pm | 8 +++-- smeserver-php.spec | 36 ++++++++++++++++--- 5 files changed, 58 insertions(+), 26 deletions(-) diff --git a/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All b/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All index e12afff..670ec80 100644 --- a/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All +++ b/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All @@ -1,7 +1,7 @@ { use esmith::ConfigDB; - +use esmith::php; my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){ @@ -11,25 +11,22 @@ foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){ my $key = $pool->key; my $pool_name = 'php' . $version . '-' . $key; - my $memory_limit = $pool->prop('MemoryLimit') || '128M'; - my $max_execution_time = $pool->prop('MaxExecutionTime') || '30'; - my $max_input_time = $pool->prop('MaxInputTime') || '60'; - my $allow_url_fopen = $pool->prop('AllowUrlFopen') || 'disabled'; - my $post_max_size = $pool->prop('PostMaxSize') || '10M'; - my $upload_max_filesize = $pool->prop('UploadMaxFilesize') || '10M'; - my $file_upload = $pool->prop('FileUpload') || 'enabled'; - my $open_basedir = $pool->prop('BaseDir') || undef; - my $disabled_functions = $pool->prop('DisabledFunctions') || 'system,show_source,' . - 'symlink,exec,dl,shell_exec,' . - 'passthru,phpinfo,' . - 'escapeshellarg,escapeshellcmd'; + my $memory_limit = $pool->prop('MemoryLimit') || $defaultPHPproperties{'MemoryLimit'}; + my $max_execution_time = $pool->prop('MaxExecutionTime') || $defaultPHPproperties{'MaxExecutionTime'}; + my $max_input_time = $pool->prop('MaxInputTime') || $defaultPHPproperties{'MaxInputTime'}; + my $allow_url_fopen = $pool->prop('AllowUrlFopen') || $defaultPHPproperties{'AllowUrlFopen'}; + my $post_max_size = $pool->prop('PostMaxSize') || $defaultPHPproperties{'PostMaxSize'}; + my $upload_max_filesize = $pool->prop('UploadMaxFilesize') || $defaultPHPproperties{'UploadMaxFilesize'}; + my $file_upload = $pool->prop('FileUpload') || $defaultPHPproperties{'FileUpload'}; + my $open_basedir = $pool->prop('PHPBaseDir') || undef; + my $disabled_functions = $pool->prop('DisabledFunctions') || $defaultPHPproperties{'DisabledFunctions'}; my $user = $pool->prop('User') || 'www'; my $group = $pool->prop('Group') || $user; my $max_children = $pool->prop('MaxChildren') || '15'; my $display_errors = $pool->prop('DisplayErrors') || 'disabled'; - my $log_errors = $pool->prop('LogErrors') || 'disabled'; - my $autoprepend = $pool->prop('AutoPrependFile') || 'enabled'; - my $MailForceSender = $pool->prop('MailForceSender') || "php\@$DomainName"; + my $log_errors = $pool->prop('LogErrors') || 'enabled'; + my $autoprepend = $pool->prop('AutoPrependFile') || $defaultPHPproperties{'AutoPrependFile'}; + my $MailForceSender = $pool->prop('MailForceSender') || "$key\@$DomainName"; # Format vars my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/php/auth_translation.php"; diff --git a/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions b/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions index b47e5cf..7bf671f 100644 --- a/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions +++ b/root/etc/e-smith/templates/etc/php.ini/10LanguageOptions @@ -13,7 +13,10 @@ output_handler = zlib.output_compression = Off implicit_flush = Off unserialize_callback_func = -serialize_precision = 17 +serialize_precision = { + my $SerializePrecision = $phpcur->prop(SerializePrecision) || $php{SerializePrecision} || "-1"; + $OUT .= "$SerializePrecision"; +} disable_functions = disable_classes = safe_mode = Off diff --git a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session index d456d4a..b21f4e8 100644 --- a/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session +++ b/root/etc/e-smith/templates/etc/php.ini/80ModuleSettings16Session @@ -23,8 +23,10 @@ session.cache_expire = 180 session.use_trans_sid = {$phpcur->prop(SessionUseTransSid) || $php{SessionUseTransSid} || "On"} url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" session.use_strict_mode = Off -session.sid_bits_per_character = 4 -session.sid_length = 32 +{return "" if $PHP_VERSION > 84; +$OUT .= "session.sid_length = 32 +session.sid_bits_per_character = 4"; +} session.trans_sid_tags = "a=href,area=href,frame=src,form=" { return "" if $PHP_VERSION eq ""; diff --git a/root/usr/share/perl5/vendor_perl/esmith/php.pm b/root/usr/share/perl5/vendor_perl/esmith/php.pm index 6c4b943..5d7b1c0 100644 --- a/root/usr/share/perl5/vendor_perl/esmith/php.pm +++ b/root/usr/share/perl5/vendor_perl/esmith/php.pm @@ -4,8 +4,8 @@ use strict; use warnings; use esmith::ConfigDB; -our $PHPDEFAULT = 82; -our $BASEPHP = 81; +our $PHPDEFAULT = 84; +our $BASEPHP = 83; our @ISA = qw(Exporter); our @EXPORT = qw( listPHPVersionFPM listPHPVersionShort listPHPVersionHash listPHPVersionHashShort PHPdefault PHPbase VersionToUse PhpFpmVersionToUse $defaultdisabledfunc %defaultPHPproperties); @@ -59,6 +59,7 @@ print "'$_'\n" for listPHPVersionFPM('all'); 'php81-php-fpm' 'php82-php-fpm' 'php83-php-fpm' +'php84-php-fpm' this will return only available and enabled print "'$_'\n" for listPHPVersionFPM('enabled'); @@ -92,6 +93,7 @@ print "'$_'\n" for listPHPVersionShort('all'); '81' '82' '83' +'84' this will returnonly available and enabled print "'$_'\n" for listPHPVersionShort('enabled'); @@ -119,6 +121,7 @@ print "$_ => $list{$_}\n" for (sort keys %list); 81 => php81-php-fpm 82 => php82-php-fpm 83 => php83-php-fpm +84 => php84-php-fpm =cut sub listPHPVersionHash { @@ -148,6 +151,7 @@ print "$_ => $list{$_}\n" for (sort keys %list); 81 => php81 82 => php82 83 => php83 +84 => php84 =cut sub listPHPVersionHashShort { diff --git a/smeserver-php.spec b/smeserver-php.spec index e9ba90a..571ea3d 100644 --- a/smeserver-php.spec +++ b/smeserver-php.spec @@ -1,5 +1,5 @@ %define version 11.0.0 -%define release 11 +%define release 12 %define name smeserver-php %global debug_package %{nil} @@ -15,7 +15,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArch: x86_64 BuildRequires: smeserver-devtools -Requires: smeserver-base >= 5.6.0 +Requires: smeserver-base >= 11.0.0 Provides: e-smith-php = %{version}-%{release} Obsoletes: e-smith-php < %{version} Provides: smeserver-webapps-common @@ -185,6 +185,27 @@ Requires: php83-php-process Requires: php83-php-snmp Requires: php83-php, php83-php-enchant , php83-php-pdo php83-php-tidy , php83-php-mysqlnd php83-php-pecl-zip +# PHP 8.4 +Requires: php84-php-cli +Requires: php84-php-ldap +Requires: php84-php-pecl-imap +Requires: php84-php-gd +Requires: php84-php-xml +Requires: php84-php-pecl-xmlrpc +Requires: php84-php-soap +Requires: php84-php-opcache +Requires: php84-php-fpm +Requires: php84-php-mbstring +Requires: php84-php-json +Requires: php84-php-bcmath +Requires: php84-php-intl +Requires: php84-php-pear +Requires: php84-php-process +Requires: php84-php-snmp +Requires: php84 php84-php, php84-php-enchant , php84-php-pdo php84-php-tidy , php84-php-mysqlnd php84-php-pecl-zip +Requires: php84-php-maxminddb, php84-php-pecl-pspel + + %description Manage PHP FPM pools, and switch between PHP versions easily @@ -209,7 +230,7 @@ echo "[Install]" > root/usr/lib/systemd/system/php-fpm.service.d/51koozali.conf echo "WantedBy=sme-server.target" >> root/usr/lib/systemd/system/php-fpm.service.d/51koozali.conf %{__mkdir_p} root/etc/e-smith/templates.metadata/etc/logrotate.d/ -for phpver in "72" "73" "74" "80" "81" "82" "83"; do +for phpver in "72" "73" "74" "80" "81" "82" "83" "84"; do #needed folder %{__mkdir_p} root/var/log/php/php$phpver/ %{__mkdir_p} root/var/lib/php/php$phpver/{session,tmp,opcache,wsdlcache} @@ -235,7 +256,7 @@ echo "WantedBy=sme-server.target" >> root/usr/lib/systemd/system/php$phpver-php- done # php7* -for phpver in "73" "74" "80" "81" "82" "83"; do +for phpver in "73" "74" "80" "81" "82" "83" "84"; do #cp ph72 metada mkdir -p root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver/ cp -a root/etc/e-smith/templates.metadata/etc/opt/remi/php72/* root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver/ @@ -262,7 +283,7 @@ done --dir /var/lib/php/php/tmp 'attr(0770,root,www)' \ --dir /var/lib/php/php/opcache 'attr(0770,root,www)' \ --dir /var/lib/php/php/wsdlcache 'attr(0770,root,www)' \ -`for phpver in "72" "73" "74" "80" "81" "82" "83"; do echo -n "--dir /var/log/php/php$phpver attr(0770,root,www) --dir /var/lib/php/php$phpver/session attr(0770,root,www) --dir /var/lib/php/php$phpver/tmp attr(0770,root,www) --dir /var/lib/php/php$phpver/opcache attr(0770,root,www) --dir /var/lib/php/php$phpver/wsdlcache attr(0770,root,www) ";done ` \ +`for phpver in "72" "73" "74" "80" "81" "82" "83" "84"; do echo -n "--dir /var/log/php/php$phpver attr(0770,root,www) --dir /var/lib/php/php$phpver/session attr(0770,root,www) --dir /var/lib/php/php$phpver/tmp attr(0770,root,www) --dir /var/lib/php/php$phpver/opcache attr(0770,root,www) --dir /var/lib/php/php$phpver/wsdlcache attr(0770,root,www) ";done ` \ > %{name}-%{version}-filelist @@ -281,6 +302,11 @@ rm -rf $RPM_BUILD_ROOT %preun %changelog +* Tue Dec 17 2024 Jean-Philippe Pialasse 11.0.0-12.sme +- add php84 support [SME: 12805] +- set php84 as default and php83 as base php as defined by module +- set new value for serialize_precision [SME: 12430] + * Tue Nov 12 2024 Jean-Philippe Pialasse 11.0.0-11.sme - fix error: stat of error.log failed: Permission denied [SME: 12665]