Skip to content

Commit abaf03c

Browse files
authored
deduplicate installation instructions in README(#2013)
1 parent fc5f6ef commit abaf03c

3 files changed

Lines changed: 51 additions & 28 deletions

File tree

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ install an appropriate version for your platform:
2525

2626
```console
2727
curl https://frankenphp.dev/install.sh | sh
28-
mv frankenphp /usr/local/bin/
2928
```
3029

3130
### Standalone Binary
@@ -35,6 +34,8 @@ containing [PHP 8.4](https://www.php.net/releases/8.4/en.php) and most popular P
3534

3635
[Download FrankenPHP](https://github.com/php/frankenphp/releases)
3736

37+
**Installing extensions:** Most common extensions are bundled. It's not possible to install more extensions.
38+
3839
### rpm Packages
3940

4041
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:
4344
sudo dnf install https://rpm.henderkes.com/static-php-1-0.noarch.rpm
4445
sudo dnf module enable php-zts:static-8.4 # 8.2-8.5 available
4546
sudo dnf install frankenphp
46-
# to install extensions:
47-
sudo dnf install php-zts-xdebug
48-
# if an extension is not available by default, install it with pie
47+
```
48+
49+
**Installing extensions:** `sudo dnf install php-zts-<extension>`
50+
51+
For extensions not available by default, use [PIE](https://github.com/php/pie):
52+
53+
```console
4954
sudo dnf install php-zts-devel
5055
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
5156
```
@@ -59,44 +64,46 @@ sudo curl -fsSL https://key.henderkes.com/static-php.gpg -o /usr/share/keyrings/
5964
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 && \
6065
sudo apt update
6166
sudo apt install frankenphp
62-
# to install extensions:
63-
sudo apt install php-zts-xdebug
64-
# if an extension is not available by default, install it with pie
65-
sudo apt install php-zts-devel
66-
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
6767
```
6868

69-
### Usage
70-
71-
To serve the content of the current directory, run:
72-
73-
```console
74-
frankenphp php-server
75-
```
69+
**Installing extensions:** `sudo apt install php-zts-<extension>`
7670

77-
You can also run command-line scripts with:
71+
For extensions not available by default, use [PIE](https://github.com/php/pie):
7872

7973
```console
80-
frankenphp php-cli /path/to/your/script.php
74+
sudo apt install php-zts-devel
75+
sudo pie install asgrim/example-pie-extension --with-php-config=php-config-zts
8176
```
8277

8378
### Homebrew
8479

8580
FrankenPHP is also available as a [Homebrew](https://brew.sh) package for macOS and Linux.
8681

87-
To install it:
88-
8982
```console
9083
brew install dunglas/frankenphp/frankenphp
9184
```
9285

86+
**Installing extensions:** Use [PIE](https://github.com/php/pie).
87+
88+
### Usage
89+
9390
To serve the content of the current directory, run:
9491

9592
```console
9693
frankenphp php-server
9794
```
9895

99-
If you need extensions, you will have to install them with [pie](https://github.com/php/pie).
96+
You can also run command-line scripts with:
97+
98+
```console
99+
frankenphp php-cli /path/to/your/script.php
100+
```
101+
102+
For the deb and rpm packages, you can also start the systemd service:
103+
104+
```console
105+
sudo systemctl start frankenphp
106+
```
100107

101108
### Docker
102109

docs/compile.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ xcaddy build \
103103
--output frankenphp \
104104
--with github.com/dunglas/frankenphp/caddy \
105105
--with github.com/dunglas/mercure/caddy \
106-
--with github.com/dunglas/vulcain/caddy
106+
--with github.com/dunglas/vulcain/caddy \
107+
--with github.com/dunglas/caddy-cbrotli
107108
# Add extra Caddy modules and FrankenPHP extensions here
109+
# optionally, if you would like to compile from your frankenphp sources:
110+
# --with github.com/dunglas/frankenphp=$(pwd) \
111+
# --with github.com/dunglas/frankenphp/caddy=$(pwd)/caddy
112+
108113
```
109114

110115
> [!TIP]

install.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Linux*)
4242
${SUDO} dnf -y module enable php-zts:static-8.4 || true
4343
${SUDO} dnf -y install frankenphp
4444
echo
45-
echo "🥳 FrankenPHP installed successfully"
45+
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
46+
echo "❗ The systemd service uses the Caddyfile in ${italic}/etc/frankenphp/Caddyfile${normal}"
47+
echo "❗ Your php.ini is found in ${italic}/etc/php-zts/php.ini${normal}"
4648
echo
4749
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
4850
exit 0
@@ -64,7 +66,9 @@ Linux*)
6466
${SUDO} apt-get -y install frankenphp
6567
fi
6668
echo
67-
echo "🥳 FrankenPHP installed successfully."
69+
echo "🥳 FrankenPHP installed to ${italic}/usr/bin/frankenphp${normal} successfully."
70+
echo "❗ The systemd service uses the Caddyfile in ${italic}/etc/frankenphp/Caddyfile${normal}"
71+
echo "❗ Your php.ini is found in ${italic}/etc/php-zts/php.ini${normal}"
6872
echo
6973
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"
7074
exit 0
@@ -131,13 +135,20 @@ ${SUDO} chmod +x "${DEST}"
131135
if command -v setcap >/dev/null 2>&1; then
132136
${SUDO} setcap 'cap_net_bind_service=+ep' "${DEST}" || true
133137
else
134-
echo " install setcap (e.g. libcap2-bin) to allow FrankenPHP to bind to ports 80/443 without root:"
135-
echo " sudo setcap 'cap_net_bind_service=+ep' \"${DEST}\""
138+
echo " install setcap (e.g. libcap2-bin) to allow FrankenPHP to bind to ports 80/443 without root:"
139+
echo " ${bold}sudo setcap 'cap_net_bind_service=+ep' \"${DEST}\"${normal}"
136140
fi
137141

138142
echo
139143
echo "🥳 FrankenPHP downloaded successfully to ${italic}${DEST}${normal}"
140-
echo "🔧 Move the binary to ${italic}/usr/local/bin/${normal} or another directory in your ${italic}PATH${normal} to use it globally:"
141-
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
144+
echo "❗ It uses ${italic}/etc/frankenphp/php.ini${normal} if found."
145+
case ":$PATH:" in
146+
*":$DEST:"*) ;;
147+
*)
148+
echo "🔧 Move the binary to ${italic}/usr/local/bin/${normal} or another directory in your ${italic}PATH${normal} to use it globally:"
149+
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
150+
;;
151+
esac
152+
142153
echo
143154
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"

0 commit comments

Comments
 (0)