Add php8.2 and drop secp256k1 library which is only supported in php7

This commit is contained in:
2022-12-10 21:32:44 +01:00
parent dedf4d971d
commit 20bf31c496
6 changed files with 101 additions and 19 deletions

View File

@ -0,0 +1,16 @@
# This service is actually a systemd target,
# but we are using a service since targets cannot be reloaded.
[Unit]
Description=The PHP 8.2 FastCGI Process Manager (multi instance master)
Documentation=man:php-fpm8.2(8)
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,35 @@
[Unit]
Description=The PHP 8.2 FastCGI Process Manager (instance %i)
Documentation=man:php-fpm8.2(8)
After=network.target
PartOf=php8.2-fpm.service
ReloadPropagatedFrom=php8.2-fpm.service
[Service]
Type=notify
PIDFile=/run/php/php8.2-fpm-%i.pid
ExecStart=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm-%i.conf
ExecReload=/bin/kill -USR2 $MAINPID
LimitNOFILE=100000
TimeoutStartSec=300
ProtectSystem=strict
PrivateTmp=true
NoNewPrivileges=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
SystemCallArchitectures=native
ReadWritePaths=-/var/log/
ReadWritePaths=-/var/run/
ReadWritePaths=-/run/
InaccessiblePaths=-/root/
CPUQuota=100%
MemoryHigh=25%
MemoryMax=35%
RuntimeDirectory=php
RuntimeDirectoryPreserve=yes
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,39 @@
[Unit]
Description=The PHP 8.2 FastCGI Process Manager
Documentation=man:php-fpm8.2(8)
After=network.target
PartOf=php8.2-fpm.service
ReloadPropagatedFrom=php8.2-fpm.service
[Service]
Type=notify
PIDFile=/run/php/php8.2-fpm.pid
ExecStart=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
LimitNOFILE=100000
TimeoutStartSec=300
ProtectSystem=strict
PrivateTmp=true
# sendmail requires it...
#NoNewPrivileges=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
SystemCallArchitectures=native
ReadWritePaths=-/var/log/
ReadWritePaths=-/var/run/
ReadWritePaths=-/run/
ReadWritePaths=-/var/local/squirrelmail/
ReadWritePaths=-/var/www/
ReadWritePaths=-/var/spool/postfix/
InaccessiblePaths=-/root/
CPUQuota=100%
MemoryHigh=25%
MemoryMax=35%
RuntimeDirectory=php
RuntimeDirectoryPreserve=yes
[Install]
WantedBy=multi-user.target

View File

@ -25,9 +25,6 @@ npm i -g yarn
if [ ! -e libssh2 ]; then if [ ! -e libssh2 ]; then
git clone https://github.com/libssh2/libssh2 git clone https://github.com/libssh2/libssh2
fi fi
if [ ! -e secp256k1 ]; then
git clone https://github.com/bitcoin-core/secp256k1
fi
if [ ! -e ImageMagick ]; then if [ ! -e ImageMagick ]; then
git clone https://github.com/ImageMagick/ImageMagick git clone https://github.com/ImageMagick/ImageMagick
fi fi
@ -82,10 +79,6 @@ fi
if [ ! -e php-rar ]; then if [ ! -e php-rar ]; then
git clone https://github.com/cataphract/php-rar git clone https://github.com/cataphract/php-rar
fi fi
if [ ! -e secp256k1-php ]; then
git clone https://github.com/Bit-Wasp/secp256k1-php
fi
ln -sf secp256k1-php/secp256k1 secp256k1
if [ ! -e igbinary ]; then if [ ! -e igbinary ]; then
git clone https://github.com/igbinary/igbinary git clone https://github.com/igbinary/igbinary
fi fi
@ -106,17 +99,10 @@ make distclean
ldconfig ldconfig
cd ../ImageMagick cd ../ImageMagick
git fetch --all git fetch --all
git checkout 7.1.0-51 git checkout 7.1.0-53
CXXFLAGS='-O3 -mtune=native -march=native' CFLAGS='-O3 -mtune=native -march=native' ./configure --without-perl --without-magick-plus-plus --with-rsvg=yes --disable-openmp CXXFLAGS='-O3 -mtune=native -march=native' CFLAGS='-O3 -mtune=native -march=native' ./configure --without-perl --without-magick-plus-plus --with-rsvg=yes --disable-openmp
make -j $PROC_LIMIT install make -j $PROC_LIMIT install
make distclean make distclean
cd ../secp256k1
git fetch --all
git checkout 44c2452fd387f7ca604ab42d73746e7d3a44d8a2
./autogen.sh
CFLAGS='-O3 -mtune=native -march=native' ./configure --enable-experimental --enable-module-ecdh --enable-module-recovery
make -j $PROC_LIMIT install
make distclean
cd ../luajit2 cd ../luajit2
git fetch --all git fetch --all
git checkout v2.1-20220411 git checkout v2.1-20220411
@ -1392,7 +1378,6 @@ cd php-ext-brotli && git fetch --all && git checkout 0.13.1 && cd ..
cd imagick && git fetch --all && git checkout 3.7.0 && cd .. cd imagick && git fetch --all && git checkout 3.7.0 && cd ..
cd php-gnupg && git fetch --all --recurse-submodules && git checkout gnupg-1.5.1 --recurse-submodules && cd .. cd php-gnupg && git fetch --all --recurse-submodules && git checkout gnupg-1.5.1 --recurse-submodules && cd ..
cd php-rar && git fetch --all && git checkout ab26d285759e4c917879967b09976a44829ed570 && cd .. cd php-rar && git fetch --all && git checkout ab26d285759e4c917879967b09976a44829ed570 && cd ..
cd secp256k1-php && git fetch --all && git checkout a1fef29baabc6de9540ada175b967068ada1f48c && cd ..
cd igbinary && git fetch --all && git checkout 3.2.7 && cd .. cd igbinary && git fetch --all && git checkout 3.2.7 && cd ..
cd msgpack-php && git fetch --all && git checkout msgpack-2.2.0RC1 && cd .. cd msgpack-php && git fetch --all && git checkout msgpack-2.2.0RC1 && cd ..
rm -rf ssh2-* rm -rf ssh2-*
@ -1400,13 +1385,19 @@ curl -sSf https://pecl.php.net/get/ssh2 | tar xzvf - --exclude package.xml
cd .. cd ..
git fetch --all git fetch --all
git fetch --all --tags git fetch --all --tags
git checkout php-8.1.12 git checkout php-8.2.0
./buildconf -f
LIBS='-lgpg-error' CXXFLAGS='-O3 -mtune=native -march=native' CFLAGS='-O3 -mtune=native -march=native' ./configure -C --enable-re2c-cgoto --prefix=/usr --with-config-file-scan-dir=/etc/php/8.2/fpm/conf.d --libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.2 --program-suffix=8.2 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --enable-fpm --enable-cli --disable-cgi --disable-phpdbg --with-fpm-systemd --with-fpm-user=www-data --with-fpm-group=www-data --with-layout=GNU --disable-dtrace --disable-short-tags --without-valgrind --disable-shared --disable-debug --disable-rpath --without-pear --with-openssl --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --with-qdbm --with-lmdb --enable-exif --enable-ftp --enable-gd --with-external-gd --with-jpeg --with-webp --with-xpm --with-freetype --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --with-imap --with-imap-ssl --with-kerberos --enable-intl --with-ldap --with-ldap-sasl --enable-mbstring --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-zlib --with-libedit --with-readline --enable-shmop --enable-soap --enable-sockets --with-sodium --with-password-argon2 --with-tidy --with-xsl --with-enchant --with-pspell --with-zip --with-ffi --enable-apcu --enable-brotli --with-libbrotli --with-imagick --with-ssh2 --with-gnupg --enable-rar --enable-igbinary --with-msgpack
make -j $PROC_LIMIT install
make distclean
git reset --hard
git checkout php-8.1.13
./buildconf -f ./buildconf -f
LIBS='-lgpg-error' CXXFLAGS='-O3 -mtune=native -march=native' CFLAGS='-O3 -mtune=native -march=native' ./configure -C --enable-re2c-cgoto --prefix=/usr --with-config-file-scan-dir=/etc/php/8.1/fpm/conf.d --libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.1 --program-suffix=8.1 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --enable-fpm --enable-cli --disable-cgi --disable-phpdbg --with-fpm-systemd --with-fpm-user=www-data --with-fpm-group=www-data --with-layout=GNU --disable-dtrace --disable-short-tags --without-valgrind --disable-shared --disable-debug --disable-rpath --without-pear --with-openssl --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --with-qdbm --with-lmdb --enable-exif --enable-ftp --enable-gd --with-external-gd --with-jpeg --with-webp --with-xpm --with-freetype --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --with-imap --with-imap-ssl --with-kerberos --enable-intl --with-ldap --with-ldap-sasl --enable-mbstring --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-zlib --with-libedit --with-readline --enable-shmop --enable-soap --enable-sockets --with-sodium --with-password-argon2 --with-tidy --with-xsl --with-enchant --with-pspell --with-zip --with-ffi --enable-apcu --enable-brotli --with-libbrotli --with-imagick --with-ssh2 --with-gnupg --enable-rar --enable-igbinary --with-msgpack LIBS='-lgpg-error' CXXFLAGS='-O3 -mtune=native -march=native' CFLAGS='-O3 -mtune=native -march=native' ./configure -C --enable-re2c-cgoto --prefix=/usr --with-config-file-scan-dir=/etc/php/8.1/fpm/conf.d --libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.1 --program-suffix=8.1 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --enable-fpm --enable-cli --disable-cgi --disable-phpdbg --with-fpm-systemd --with-fpm-user=www-data --with-fpm-group=www-data --with-layout=GNU --disable-dtrace --disable-short-tags --without-valgrind --disable-shared --disable-debug --disable-rpath --without-pear --with-openssl --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --with-qdbm --with-lmdb --enable-exif --enable-ftp --enable-gd --with-external-gd --with-jpeg --with-webp --with-xpm --with-freetype --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --with-imap --with-imap-ssl --with-kerberos --enable-intl --with-ldap --with-ldap-sasl --enable-mbstring --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-zlib --with-libedit --with-readline --enable-shmop --enable-soap --enable-sockets --with-sodium --with-password-argon2 --with-tidy --with-xsl --with-enchant --with-pspell --with-zip --with-ffi --enable-apcu --enable-brotli --with-libbrotli --with-imagick --with-ssh2 --with-gnupg --enable-rar --enable-igbinary --with-msgpack
make -j $PROC_LIMIT install make -j $PROC_LIMIT install
make distclean make distclean
git reset --hard git reset --hard
git checkout php-8.0.25 git checkout php-8.0.26
cat <<EOF | git apply - cat <<EOF | git apply -
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 19e7a0d79e..4d159895ac 100644 index 19e7a0d79e..4d159895ac 100644

View File

@ -26,7 +26,7 @@ const ENABLE_SHELL_ACCESS=true; //allows users to login via ssh, when disabled o
const ADMIN_PASSWORD='MY_PASSWORD'; //password for admin interface const ADMIN_PASSWORD='MY_PASSWORD'; //password for admin interface
const SERVICE_INSTANCES=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's']; //one character per instance - run multiple tor+php-fpm instances for load balancing, remove all but one instance if you expect less than 200 accounts. If tor starts using 100% cpu and failing circuits every few hours after a restart, add more instances. In my experience this happens around 250 hidden services per instance - run setup.php after change const SERVICE_INSTANCES=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's']; //one character per instance - run multiple tor+php-fpm instances for load balancing, remove all but one instance if you expect less than 200 accounts. If tor starts using 100% cpu and failing circuits every few hours after a restart, add more instances. In my experience this happens around 250 hidden services per instance - run setup.php after change
const DISABLED_PHP_VERSIONS=[]; //php versions still installed on the system but no longer offered for new accounts const DISABLED_PHP_VERSIONS=[]; //php versions still installed on the system but no longer offered for new accounts
const PHP_VERSIONS=[6 => '8.0', 7 => '8.1']; //currently active php versions const PHP_VERSIONS=[6 => '8.0', 7 => '8.1', 8 => '8.2']; //currently active php versions
const DEFAULT_PHP_VERSION='8.1'; //default php version const DEFAULT_PHP_VERSION='8.1'; //default php version
const PHP_CONFIG='zend_extension=opcache.so const PHP_CONFIG='zend_extension=opcache.so
memory_limit = 256M memory_limit = 256M

View File

@ -149,6 +149,7 @@ BINARIES_GENERAL=(
'paste' 'paste'
'php8.0' 'php8.0'
'php8.1' 'php8.1'
'php8.2'
'pr' 'pr'
'printenv' 'printenv'
'printf' 'printf'