Skip to content

Commit af3038f

Browse files
committed
update installation instructions to use php 8.5 and add apk alpine support
1 parent 57c58fa commit af3038f

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

docs/performance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ However, it is possible to substantially improve performance using an appropriat
77

88
By default, FrankenPHP starts 2 times more threads and workers (in worker mode) than the available numbers of CPU.
99

10-
The appropriate values depend heavily on how your application is written, what it does and your hardware.
10+
The appropriate values depend heavily on how your application is written, what it does, and your hardware.
1111
We strongly recommend changing these values. For best system stability, it is recommended to have `num_threads` x `memory_limit` < `available_memory`.
1212

1313
To find the right values, it's best to run load tests simulating real traffic.
@@ -43,7 +43,7 @@ Also, [some bugs only happen when using musl](https://github.com/php/php-src/iss
4343

4444
In production environments, we recommend using FrankenPHP linked against glibc, compiled with an appropriate optimization level.
4545

46-
This can be achieved by using the Debian Docker images, using our maintainers [.deb](https://debs.henderkes.com) or [.rpm](https://rpms.henderkes.com) packages, or by [compiling FrankenPHP from sources](compile.md).
46+
This can be achieved by using the Debian Docker images, using [our maintainers .deb, .rpm, or .apk packages](https://pkgs.henderkes.com), or by [compiling FrankenPHP from sources](compile.md).
4747

4848
## Go Runtime Configuration
4949

@@ -146,7 +146,7 @@ All usual PHP-related performance optimizations apply with FrankenPHP.
146146

147147
In particular:
148148

149-
- check that [OPcache](https://www.php.net/manual/en/book.opcache.php) is installed, enabled and properly configured
149+
- check that [OPcache](https://www.php.net/manual/en/book.opcache.php) is installed, enabled, and properly configured
150150
- enable [Composer autoloader optimizations](https://getcomposer.org/doc/articles/autoloader-optimization.md)
151151
- ensure that the `realpath` cache is big enough for the needs of your application
152152
- use [preloading](https://www.php.net/manual/en/opcache.preloading.php)

install.sh

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Linux*)
3838
echo "❗ Enter your password to grant sudo powers for package installation"
3939
${SUDO} -v || true
4040
fi
41-
${SUDO} dnf -y install https://rpm.henderkes.com/static-php-1-0.noarch.rpm
42-
${SUDO} dnf -y module enable php-zts:static-8.4 || true
41+
${SUDO} dnf -y install https://rpm.henderkes.com/static-php-1-1.noarch.rpm
42+
${SUDO} dnf -y module enable php-zts:static-8.5 || true
4343
${SUDO} dnf -y install frankenphp
4444
echo
4545
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
@@ -56,8 +56,8 @@ Linux*)
5656
echo "❗ Enter your password to grant sudo powers for package installation"
5757
${SUDO} -v || true
5858
fi
59-
${SUDO} sh -c 'curl -fsSL https://key.henderkes.com/static-php.gpg -o /usr/share/keyrings/static-php.gpg'
60-
${SUDO} sh -c 'echo "deb [signed-by=/usr/share/keyrings/static-php.gpg] https://deb.henderkes.com/ stable main" > /etc/apt/sources.list.d/static-php.list'
59+
${SUDO} sh -c 'curl -fsSL https://pkg.henderkes.com/api/packages/85/debian/repository.key -o /etc/apt/keyrings/static-php85.asc'
60+
${SUDO} sh -c 'echo "deb [signed-by=/etc/apt/keyrings/static-php85.asc] https://pkg.henderkes.com/api/packages/85/debian php-zts main" | sudo tee -a /etc/apt/sources.list.d/static-php85.list'
6161
if command -v apt >/dev/null 2>&1; then
6262
${SUDO} apt update
6363
${SUDO} apt -y install frankenphp
@@ -73,6 +73,35 @@ Linux*)
7373
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
7474
exit 0
7575
fi
76+
77+
if command -v apk >/dev/null 2>&1; then
78+
echo "📦 Detected apk. Installing FrankenPHP from APK repository..."
79+
if [ -n "${SUDO}" ]; then
80+
echo "❗ Enter your password to grant sudo powers for package installation"
81+
${SUDO} -v || true
82+
fi
83+
84+
KEY_URL="https://pkg.henderkes.com/api/packages/85/alpine/key"
85+
${SUDO} sh -c "cd /etc/apk/keys && curl -JOsS \"$KEY_URL\" 2>/dev/null || true"
86+
87+
REPO_URL="https://pkg.henderkes.com/api/packages/85/alpine/main/php-zts"
88+
if grep -q "$REPO_URL" /etc/apk/repositories 2>/dev/null; then
89+
echo "Repository already exists in /etc/apk/repositories"
90+
else
91+
${SUDO} sh -c "echo \"$REPO_URL\" >> /etc/apk/repositories"
92+
${SUDO} apk update
93+
echo "Repository added to /etc/apk/repositories"
94+
fi
95+
96+
${SUDO} apk add frankenphp
97+
echo
98+
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
99+
echo "❗ The systemd service uses the Caddyfile in ${italic}/etc/frankenphp/Caddyfile${normal}"
100+
echo "❗ Your php.ini is found in ${italic}/etc/php-zts/php.ini${normal}"
101+
echo
102+
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
103+
exit 0
104+
fi
76105
fi
77106

78107
case ${ARCH} in

0 commit comments

Comments
 (0)