frankenphp/README.md
2022-05-19 14:46:35 +02:00

1.9 KiB

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

Misc Dev Resources