Installation
Requirements
- PHP 8.2+ with ZTS (Zend Thread Safety) for multi-worker mode
- Linux x86_64/aarch64 or macOS Apple Silicon
Via PIE (recommended)
PIE is the modern PHP extension installer from the PHP Foundation.
PIE will automatically download a pre-built binary for your platform. No Rust toolchain needed.
Via Docker
FROM php:8.4-zts
RUN apt-get update && apt-get install -y unzip curl \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pcntl sockets
RUN curl -Lo /usr/local/bin/pie https://github.com/php/pie/releases/latest/download/pie.phar \
&& chmod +x /usr/local/bin/pie \
&& pie install folk-project/ext-folk
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /app
COPY . .
RUN composer install --no-dev
CMD ["php", "vendor/bin/folk-worker"]
Manual install
Download the matching ZIP from GitHub Releases, extract, and copy to your PHP extension directory:
cp folk.so $(php -r "echo ini_get('extension_dir');")/
echo "extension=folk" > $(php --ini | grep 'Scan' | awk '{print $NF}')/folk.ini
Build from Source
If you need a custom plugin set or want to build locally:
1. Install Rust
2. Install build dependencies
3. Install folk-builder
4. Create folk.build.toml
[build]
output = "folk"
[[plugin]]
crate_name = "folk-plugin-http"
version = "0.2"
config_key = "http"
[[plugin]]
crate_name = "folk-plugin-jobs"
version = "0.2"
config_key = "jobs"
5. Build
This produces folk.so. Copy it to your PHP extension directory:
cp folk.so $(php -r "echo ini_get('extension_dir');")
echo "extension=folk" > $(php --ini | grep 'Scan' | awk '{print $NF}')/folk.ini