* Tue Dec 17 2024 Jean-Philippe Pialasse <jpp@koozali.org> 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]
This commit is contained in:
Jean-Philippe Pialasse 2024-12-17 14:35:23 -05:00
parent 54b0dcf75f
commit ab89dd9752
5 changed files with 58 additions and 26 deletions

View File

@ -1,7 +1,7 @@
{ {
use esmith::ConfigDB; use esmith::ConfigDB;
use esmith::php;
my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php');
foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){ 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 $key = $pool->key;
my $pool_name = 'php' . $version . '-' . $key; my $pool_name = 'php' . $version . '-' . $key;
my $memory_limit = $pool->prop('MemoryLimit') || '128M'; my $memory_limit = $pool->prop('MemoryLimit') || $defaultPHPproperties{'MemoryLimit'};
my $max_execution_time = $pool->prop('MaxExecutionTime') || '30'; my $max_execution_time = $pool->prop('MaxExecutionTime') || $defaultPHPproperties{'MaxExecutionTime'};
my $max_input_time = $pool->prop('MaxInputTime') || '60'; my $max_input_time = $pool->prop('MaxInputTime') || $defaultPHPproperties{'MaxInputTime'};
my $allow_url_fopen = $pool->prop('AllowUrlFopen') || 'disabled'; my $allow_url_fopen = $pool->prop('AllowUrlFopen') || $defaultPHPproperties{'AllowUrlFopen'};
my $post_max_size = $pool->prop('PostMaxSize') || '10M'; my $post_max_size = $pool->prop('PostMaxSize') || $defaultPHPproperties{'PostMaxSize'};
my $upload_max_filesize = $pool->prop('UploadMaxFilesize') || '10M'; my $upload_max_filesize = $pool->prop('UploadMaxFilesize') || $defaultPHPproperties{'UploadMaxFilesize'};
my $file_upload = $pool->prop('FileUpload') || 'enabled'; my $file_upload = $pool->prop('FileUpload') || $defaultPHPproperties{'FileUpload'};
my $open_basedir = $pool->prop('BaseDir') || undef; my $open_basedir = $pool->prop('PHPBaseDir') || undef;
my $disabled_functions = $pool->prop('DisabledFunctions') || 'system,show_source,' . my $disabled_functions = $pool->prop('DisabledFunctions') || $defaultPHPproperties{'DisabledFunctions'};
'symlink,exec,dl,shell_exec,' .
'passthru,phpinfo,' .
'escapeshellarg,escapeshellcmd';
my $user = $pool->prop('User') || 'www'; my $user = $pool->prop('User') || 'www';
my $group = $pool->prop('Group') || $user; my $group = $pool->prop('Group') || $user;
my $max_children = $pool->prop('MaxChildren') || '15'; my $max_children = $pool->prop('MaxChildren') || '15';
my $display_errors = $pool->prop('DisplayErrors') || 'disabled'; my $display_errors = $pool->prop('DisplayErrors') || 'disabled';
my $log_errors = $pool->prop('LogErrors') || 'disabled'; my $log_errors = $pool->prop('LogErrors') || 'enabled';
my $autoprepend = $pool->prop('AutoPrependFile') || 'enabled'; my $autoprepend = $pool->prop('AutoPrependFile') || $defaultPHPproperties{'AutoPrependFile'};
my $MailForceSender = $pool->prop('MailForceSender') || "php\@$DomainName"; my $MailForceSender = $pool->prop('MailForceSender') || "$key\@$DomainName";
# Format vars # Format vars
my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/php/auth_translation.php"; my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/php/auth_translation.php";

View File

@ -13,7 +13,10 @@ output_handler =
zlib.output_compression = Off zlib.output_compression = Off
implicit_flush = Off implicit_flush = Off
unserialize_callback_func = unserialize_callback_func =
serialize_precision = 17 serialize_precision = {
my $SerializePrecision = $phpcur->prop(SerializePrecision) || $php{SerializePrecision} || "-1";
$OUT .= "$SerializePrecision";
}
disable_functions = disable_functions =
disable_classes = disable_classes =
safe_mode = Off safe_mode = Off

View File

@ -23,8 +23,10 @@ session.cache_expire = 180
session.use_trans_sid = {$phpcur->prop(SessionUseTransSid) || $php{SessionUseTransSid} || "On"} session.use_trans_sid = {$phpcur->prop(SessionUseTransSid) || $php{SessionUseTransSid} || "On"}
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
session.use_strict_mode = Off session.use_strict_mode = Off
session.sid_bits_per_character = 4 {return "" if $PHP_VERSION > 84;
session.sid_length = 32 $OUT .= "session.sid_length = 32
session.sid_bits_per_character = 4";
}
session.trans_sid_tags = "a=href,area=href,frame=src,form=" session.trans_sid_tags = "a=href,area=href,frame=src,form="
{ {
return "" if $PHP_VERSION eq ""; return "" if $PHP_VERSION eq "";

View File

@ -4,8 +4,8 @@ use strict;
use warnings; use warnings;
use esmith::ConfigDB; use esmith::ConfigDB;
our $PHPDEFAULT = 82; our $PHPDEFAULT = 84;
our $BASEPHP = 81; our $BASEPHP = 83;
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
our @EXPORT = qw( listPHPVersionFPM listPHPVersionShort listPHPVersionHash listPHPVersionHashShort PHPdefault PHPbase VersionToUse PhpFpmVersionToUse $defaultdisabledfunc %defaultPHPproperties); 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' 'php81-php-fpm'
'php82-php-fpm' 'php82-php-fpm'
'php83-php-fpm' 'php83-php-fpm'
'php84-php-fpm'
this will return only available and enabled this will return only available and enabled
print "'$_'\n" for listPHPVersionFPM('enabled'); print "'$_'\n" for listPHPVersionFPM('enabled');
@ -92,6 +93,7 @@ print "'$_'\n" for listPHPVersionShort('all');
'81' '81'
'82' '82'
'83' '83'
'84'
this will returnonly available and enabled this will returnonly available and enabled
print "'$_'\n" for listPHPVersionShort('enabled'); print "'$_'\n" for listPHPVersionShort('enabled');
@ -119,6 +121,7 @@ print "$_ => $list{$_}\n" for (sort keys %list);
81 => php81-php-fpm 81 => php81-php-fpm
82 => php82-php-fpm 82 => php82-php-fpm
83 => php83-php-fpm 83 => php83-php-fpm
84 => php84-php-fpm
=cut =cut
sub listPHPVersionHash { sub listPHPVersionHash {
@ -148,6 +151,7 @@ print "$_ => $list{$_}\n" for (sort keys %list);
81 => php81 81 => php81
82 => php82 82 => php82
83 => php83 83 => php83
84 => php84
=cut =cut
sub listPHPVersionHashShort { sub listPHPVersionHashShort {

View File

@ -1,5 +1,5 @@
%define version 11.0.0 %define version 11.0.0
%define release 11 %define release 12
%define name smeserver-php %define name smeserver-php
%global debug_package %{nil} %global debug_package %{nil}
@ -15,7 +15,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArch: x86_64 BuildArch: x86_64
BuildRequires: smeserver-devtools BuildRequires: smeserver-devtools
Requires: smeserver-base >= 5.6.0 Requires: smeserver-base >= 11.0.0
Provides: e-smith-php = %{version}-%{release} Provides: e-smith-php = %{version}-%{release}
Obsoletes: e-smith-php < %{version} Obsoletes: e-smith-php < %{version}
Provides: smeserver-webapps-common Provides: smeserver-webapps-common
@ -185,6 +185,27 @@ Requires: php83-php-process
Requires: php83-php-snmp Requires: php83-php-snmp
Requires: php83-php, php83-php-enchant , php83-php-pdo php83-php-tidy , php83-php-mysqlnd php83-php-pecl-zip 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 %description
Manage PHP FPM pools, and switch between PHP versions easily 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 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/ %{__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 #needed folder
%{__mkdir_p} root/var/log/php/php$phpver/ %{__mkdir_p} root/var/log/php/php$phpver/
%{__mkdir_p} root/var/lib/php/php$phpver/{session,tmp,opcache,wsdlcache} %{__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 done
# php7* # 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 #cp ph72 metada
mkdir -p root/etc/e-smith/templates.metadata/etc/opt/remi/php$phpver/ 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/ 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/tmp 'attr(0770,root,www)' \
--dir /var/lib/php/php/opcache 'attr(0770,root,www)' \ --dir /var/lib/php/php/opcache 'attr(0770,root,www)' \
--dir /var/lib/php/php/wsdlcache '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 > %{name}-%{version}-filelist
@ -281,6 +302,11 @@ rm -rf $RPM_BUILD_ROOT
%preun %preun
%changelog %changelog
* Tue Dec 17 2024 Jean-Philippe Pialasse <jpp@koozali.org> 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 <jpp@koozali.org> 11.0.0-11.sme * Tue Nov 12 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix error: stat of error.log failed: Permission denied [SME: 12665] - fix error: stat of error.log failed: Permission denied [SME: 12665]