mirror of
https://github.com/dunglas/frankenphp
synced 2024-11-23 00:30:10 +00:00
caddy | ||
testdata | ||
.gitignore | ||
cgi.go | ||
CONTRIBUTING.md | ||
Dockerfile | ||
frankenphp_test.go | ||
frankenphp.c | ||
frankenphp.go | ||
frankenphp.h | ||
go.mod | ||
go.sum | ||
README.md | ||
worker_test.go | ||
worker.go |
Caddy PHP
Install
Docker
The easiest way to get started is to use our Docker image:
docker build -t frankenphp .
Compile From Sources
Install PHP
Most distributions don't provide packages containing ZTS builds of PHP. Because the Go HTTP server uses goroutines, a ZTS build is needed.
Start by downloading the latest version of PHP, then follow the instructions according to your operating system.
Linux
./configure \
--enable-embed=static \
--enable-zts
make -j6
make install
Mac
The instructions to build on Mac and Linux are similar.
However, on Mac, you have to use the Homebrew package manager to install libiconv
and bison
.
You also need to slightly tweak the configuration.
brew install libiconv bison
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> ~/.zshrc
./configure \
--enable-embed=static \
--enable-zts \
--with-iconv=/opt/homebrew/opt/libiconv/ \
--without-pcre-jit
make -j6
make install
Compile the Go App
go get -d -v ./...
go build -v