/frankenphp-demo

Demo app for FrankenPHP

Primary LanguageHTML

FrankenPHP Demo

A demo app using FrankenPHP that uses Symfony and API Platform.

Installation

Composer

Install composer dependencies:

docker run --rm -it -v $PWD:/app composer:latest install --ignore-platform-req=php

Or if you have composer installed locally:

composer install --ignore-platform-req=php

The project

Run the project with Docker (worker mode):

docker run \
    -e FRANKENPHP_CONFIG="worker ./public/index.php" \
    -v $PWD:/app \
    -p 80:80 -p 443:443 \
    dunglas/frankenphp

PS: Docker is optional; you can also compile FrankenPHP by yourself.

Create the database (It uses a local SQLite database stored in var/data.db):

bin/console doctrine:migrations:migrate --no-interaction

Then you can access the application:

This demo is a standard Symfony application and works without FrankenPHP. Therefore, you can serve it with the Symfony CLI:

symfony serve

The repository also includes a benchmark comparing FrankenPHP and PHP-FPM.