frankenphp/README.md
Kévin Dunglas 796476d537
feat: use threads instead of GoRoutines (#6)
* feat: use threads instead of GoRoutines

* many improvements

* fix some bugs
2022-10-04 14:41:19 +02:00

2.2 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

To use FrankenPHP, you currently need to compile a fork of PHP. Patches have been contributed upstream, and some have already been merged. It will be possible to use the vanilla version of PHP starting with version 8.3.

First, get our PHP fork and prepare it:

git clone https://github.com/dunglas/php-src.git
cd php-src
git checkout frankenphp-8.2
./buildconf

Then, configure PHP for your platform:

Linux:

./configure \
    --enable-embed \
    --enable-zts \
    --disable-zend-signals

Mac:

Use the Homebrew package manager to install libiconv and bison:

brew install libiconv bison
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> ~/.zshrc

Then run the configure script:

./configure \
    --enable-embed=static \
    --enable-zts \
    --disable-zend-signals \
    --disable-opcache-jit \
    --with-iconv=/opt/homebrew/opt/libiconv/

These flags are required, but you can add other flags (extra extensions...) if needed.

Finally, compile PHP:

make -j6
make install

Compile the Go App

You can now use the Go lib and compile our Caddy build:

cd caddy/frankenphp
go build

Misc Dev Resources