deduplicate installation instructions in README(#2013)

This commit is contained in:
Marc
2025-11-26 14:19:27 +07:00
committed by GitHub
parent fc5f6ef092
commit abaf03c7f7
3 changed files with 51 additions and 28 deletions

View File

@@ -25,7 +25,6 @@ install an appropriate version for your platform:
```console
curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/
```
### Standalone Binary
@@ -35,6 +34,8 @@ containing [PHP 8.4](https://www.php.net/releases/8.4/en.php) and most popular P
[Download FrankenPHP](https://github.com/php/frankenphp/releases)
**Installing extensions:** Most common extensions are bundled. It's not possible to install more extensions.
### rpm Packages
Our maintainers offer rpm packages for all systems using `dnf`. To install, run:
@@ -43,9 +44,13 @@ Our maintainers offer rpm packages for all systems using `dnf`. To install, run:
sudo dnf install https://rpm.henderkes.com/static-php-1-0.noarch.rpm
sudo dnf module enable php-zts:static-8.4 # 8.2-8.5 available
sudo dnf install frankenphp
# to install extensions:
sudo dnf install php-zts-xdebug
# if an extension is not available by default, install it with pie
```
**Installing extensions:** `sudo dnf install php-zts-<extension>`
For extensions not available by default, use [PIE](https://github.com/php/pie):
```console
sudo dnf install php-zts-devel
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
```
@@ -59,13 +64,27 @@ sudo curl -fsSL https://key.henderkes.com/static-php.gpg -o /usr/share/keyrings/
echo "deb [signed-by=/usr/share/keyrings/static-php.gpg] https://deb.henderkes.com/ stable main" | sudo tee /etc/apt/sources.list.d/static-php.list && \
sudo apt update
sudo apt install frankenphp
# to install extensions:
sudo apt install php-zts-xdebug
# if an extension is not available by default, install it with pie
```
**Installing extensions:** `sudo apt install php-zts-<extension>`
For extensions not available by default, use [PIE](https://github.com/php/pie):
```console
sudo apt install php-zts-devel
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
```
### Homebrew
FrankenPHP is also available as a [Homebrew](https://brew.sh) package for macOS and Linux.
```console
brew install dunglas/frankenphp/frankenphp
```
**Installing extensions:** Use [PIE](https://github.com/php/pie).
### Usage
To serve the content of the current directory, run:
@@ -80,24 +99,12 @@ You can also run command-line scripts with:
frankenphp php-cli /path/to/your/script.php
```
### Homebrew
FrankenPHP is also available as a [Homebrew](https://brew.sh) package for macOS and Linux.
To install it:
For the deb and rpm packages, you can also start the systemd service:
```console
brew install dunglas/frankenphp/frankenphp
sudo systemctl start frankenphp
```
To serve the content of the current directory, run:
```console
frankenphp php-server
```
If you need extensions, you will have to install them with [pie](https://github.com/php/pie).
### Docker
Alternatively, [Docker images](https://frankenphp.dev/docs/docker/) are available:

View File

@@ -103,8 +103,13 @@ xcaddy build \
--output frankenphp \
--with github.com/dunglas/frankenphp/caddy \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
--with github.com/dunglas/vulcain/caddy \
--with github.com/dunglas/caddy-cbrotli
# Add extra Caddy modules and FrankenPHP extensions here
# optionally, if you would like to compile from your frankenphp sources:
# --with github.com/dunglas/frankenphp=$(pwd) \
# --with github.com/dunglas/frankenphp/caddy=$(pwd)/caddy
```
> [!TIP]

View File

@@ -42,7 +42,9 @@ Linux*)
${SUDO} dnf -y module enable php-zts:static-8.4 || true
${SUDO} dnf -y install frankenphp
echo
echo "🥳 FrankenPHP installed successfully"
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
echo "❗ The systemd service uses the Caddyfile in ${italic}/etc/frankenphp/Caddyfile${normal}"
echo "❗ Your php.ini is found in ${italic}/etc/php-zts/php.ini${normal}"
echo
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
exit 0
@@ -64,7 +66,9 @@ Linux*)
${SUDO} apt-get -y install frankenphp
fi
echo
echo "🥳 FrankenPHP installed successfully."
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
echo "❗ The systemd service uses the Caddyfile in ${italic}/etc/frankenphp/Caddyfile${normal}"
echo "❗ Your php.ini is found in ${italic}/etc/php-zts/php.ini${normal}"
echo
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
exit 0
@@ -131,13 +135,20 @@ ${SUDO} chmod +x "${DEST}"
if command -v setcap >/dev/null 2>&1; then
${SUDO} setcap 'cap_net_bind_service=+ep' "${DEST}" || true
else
echo "❗ install setcap (e.g. libcap2-bin) to allow FrankenPHP to bind to ports 80/443 without root:"
echo " sudo setcap 'cap_net_bind_service=+ep' \"${DEST}\""
echo "❗ install setcap (e.g. libcap2-bin) to allow FrankenPHP to bind to ports 80/443 without root:"
echo " ${bold}sudo setcap 'cap_net_bind_service=+ep' \"${DEST}\"${normal}"
fi
echo
echo "🥳 FrankenPHP downloaded successfully to ${italic}${DEST}${normal}"
echo "🔧 Move the binary to ${italic}/usr/local/bin/${normal} or another directory in your ${italic}PATH${normal} to use it globally:"
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
echo "❗ It uses ${italic}/etc/frankenphp/php.ini${normal} if found."
case ":$PATH:" in
*":$DEST:"*) ;;
*)
echo "🔧 Move the binary to ${italic}/usr/local/bin/${normal} or another directory in your ${italic}PATH${normal} to use it globally:"
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
;;
esac
echo
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"