Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,28 @@ Go to `https://localhost`, and enjoy!
### Standalone Binary

If you prefer not to use Docker, we provide standalone FrankenPHP binaries for Linux and macOS
containing [PHP 8.3](https://www.php.net/releases/8.3/en.php) and most popular PHP extensions: [Download FrankenPHP](https://github.com/dunglas/frankenphp/releases)
containing [PHP 8.3](https://www.php.net/releases/8.3/en.php) and most popular PHP extensions.

On Windows, use [WSL](https://learn.microsoft.com/windows/wsl/) to run FrankenPHP.

[Download FrankenPHP](https://github.com/dunglas/frankenphp/releases) or copy this line into your
terminal to automatically install the version appropriate for your platform:

```console
curl -sLK https://raw.githubusercontent.com/dunglas/frankenphp/main/install.sh | sh
mv frankenphp /usr/local/bin/
```

To serve the content of the current directory, run:

```console
./frankenphp php-server
frankenphp php-server
```

You can also run command-line scripts with:

```console
./frankenphp php-cli /path/to/your/script.php
frankenphp php-cli /path/to/your/script.php
```

## Docs
Expand Down
71 changes: 71 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/sh

Comment thread
withinboredom marked this conversation as resolved.
set -e

if [ -z "${BIN_DIR}" ]; then
BIN_DIR=$(pwd)
fi

THE_ARCH_BIN=""
DEST=${BIN_DIR}/frankenphp

OS=$(uname -s)
ARCH=$(uname -m)

case ${OS} in
Linux*)
case ${ARCH} in
aarch64)
THE_ARCH_BIN="frankenphp-linux-aarch64"
;;
x86_64)
THE_ARCH_BIN="frankenphp-linux-x86_64"
;;
*)
THE_ARCH_BIN=""
;;
esac
;;
Darwin*)
case ${ARCH} in
arm64)
THE_ARCH_BIN="frankenphp-mac-arm64"
;;
*)
THE_ARCH_BIN="frankenphp-mac-x86_64"
;;
esac
;;
Windows|MINGW64_NT*)
echo "Install and use WSL to use FrankenPHP on Windows: https://learn.microsoft.com/windows/wsl/"
exit 1
;;
*)
THE_ARCH_BIN=""
;;
esac

if [ -z "${THE_ARCH_BIN}" ]; then
echo "FrankenPHP is not supported on ${OS} and ${ARCH}"
exit 1
fi


SUDO=""

# check if $DEST is writable and suppress an error message
touch "${DEST}" 2>/dev/null

# we need sudo powers to write to DEST
if [ $? -eq 1 ]; then
echo "You do not have permission to write to ${DEST}, enter your password to grant sudo powers"
SUDO="sudo"
fi

${SUDO} curl -L --progress-bar "https://github.com/dunglas/frankenphp/releases/latest/download/${THE_ARCH_BIN}" -o "${DEST}"

${SUDO} chmod +x "${DEST}"


echo "FrankenPHP downloaded successfully to ${DEST}"
echo "Move the binary to /usr/local/bin/ or another directory in your PATH to use it globally: sudo mv ${DEST} /usr/local/bin/"