mirror of
https://github.com/dunglas/frankenphp
synced 2024-10-16 09:08:22 +00:00
C-Thread-Pool@d42cc5a2f7 | ||
caddy | ||
internal/testserver | ||
testdata | ||
.gitignore | ||
.gitmodules | ||
cgi.go | ||
CONTRIBUTING.md | ||
Dockerfile | ||
frankenphp_test.go | ||
frankenphp.c | ||
frankenphp.go | ||
frankenphp.h | ||
go.mod | ||
go.sum | ||
options.go | ||
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
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