mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
deduplicate installation instructions in README(#2013)
This commit is contained in:
49
README.md
49
README.md
@@ -25,7 +25,6 @@ install an appropriate version for your platform:
|
|||||||
|
|
||||||
```console
|
```console
|
||||||
curl https://frankenphp.dev/install.sh | sh
|
curl https://frankenphp.dev/install.sh | sh
|
||||||
mv frankenphp /usr/local/bin/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Standalone Binary
|
### 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)
|
[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
|
### rpm Packages
|
||||||
|
|
||||||
Our maintainers offer rpm packages for all systems using `dnf`. To install, run:
|
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 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 module enable php-zts:static-8.4 # 8.2-8.5 available
|
||||||
sudo dnf install frankenphp
|
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 dnf install php-zts-devel
|
||||||
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
|
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 && \
|
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 update
|
||||||
sudo apt install frankenphp
|
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 apt install php-zts-devel
|
||||||
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
|
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
|
### Usage
|
||||||
|
|
||||||
To serve the content of the current directory, run:
|
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
|
frankenphp php-cli /path/to/your/script.php
|
||||||
```
|
```
|
||||||
|
|
||||||
### Homebrew
|
For the deb and rpm packages, you can also start the systemd service:
|
||||||
|
|
||||||
FrankenPHP is also available as a [Homebrew](https://brew.sh) package for macOS and Linux.
|
|
||||||
|
|
||||||
To install it:
|
|
||||||
|
|
||||||
```console
|
```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
|
### Docker
|
||||||
|
|
||||||
Alternatively, [Docker images](https://frankenphp.dev/docs/docker/) are available:
|
Alternatively, [Docker images](https://frankenphp.dev/docs/docker/) are available:
|
||||||
|
|||||||
@@ -103,8 +103,13 @@ xcaddy build \
|
|||||||
--output frankenphp \
|
--output frankenphp \
|
||||||
--with github.com/dunglas/frankenphp/caddy \
|
--with github.com/dunglas/frankenphp/caddy \
|
||||||
--with github.com/dunglas/mercure/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
|
# 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]
|
> [!TIP]
|
||||||
|
|||||||
23
install.sh
23
install.sh
@@ -42,7 +42,9 @@ Linux*)
|
|||||||
${SUDO} dnf -y module enable php-zts:static-8.4 || true
|
${SUDO} dnf -y module enable php-zts:static-8.4 || true
|
||||||
${SUDO} dnf -y install frankenphp
|
${SUDO} dnf -y install frankenphp
|
||||||
echo
|
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
|
||||||
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -64,7 +66,9 @@ Linux*)
|
|||||||
${SUDO} apt-get -y install frankenphp
|
${SUDO} apt-get -y install frankenphp
|
||||||
fi
|
fi
|
||||||
echo
|
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
|
||||||
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -131,13 +135,20 @@ ${SUDO} chmod +x "${DEST}"
|
|||||||
if command -v setcap >/dev/null 2>&1; then
|
if command -v setcap >/dev/null 2>&1; then
|
||||||
${SUDO} setcap 'cap_net_bind_service=+ep' "${DEST}" || true
|
${SUDO} setcap 'cap_net_bind_service=+ep' "${DEST}" || true
|
||||||
else
|
else
|
||||||
echo "❗ install setcap (e.g. libcap2-bin) to allow FrankenPHP to bind to ports 80/443 without root:"
|
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 " ${bold}sudo setcap 'cap_net_bind_service=+ep' \"${DEST}\"${normal}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "🥳 FrankenPHP downloaded successfully to ${italic}${DEST}${normal}"
|
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 "❗ It uses ${italic}/etc/frankenphp/php.ini${normal} if found."
|
||||||
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
|
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
|
||||||
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
|
||||||
|
|||||||
Reference in New Issue
Block a user