The
demo/ folder is not included when you install the bundle via Composer. It exists only in the source repository. To run the demos, clone the repository first.Demo applications
Each demo includes:
- Independent
docker-compose.ymlfor easy setup - Complete test suite to verify bundle integration
- Example controller and Twig templates
- Web Profiler integration
- 100% code coverage for demo code
Starting a demo
- Symfony 6
- Symfony 7
- Symfony 8
1
Start the container and install dependencies
From the bundle root:This builds the image, installs Composer dependencies, clears the Symfony cache, and starts the server.
2
Open the demo
Navigate to http://localhost:8001 in your browser.The Twig Inspector toolbar appears at the bottom of the page.
docker-compose directly:Makefile helpers
You can also use thedemo/ Makefile to manage all demos from one place:
Running demo tests
Each demo has its own test suite with code coverage:FrankenPHP configuration
Each demo runs FrankenPHP (Caddy + PHP in a single container) with two Caddyfile configurations:
The demos run in development mode by default. The Docker entrypoint detects
APP_ENV=dev and copies Caddyfile.dev (no worker, cache-busting headers) over the default Caddyfile before starting FrankenPHP.
Development Caddyfile
Production Caddyfile
APP_ENV=prod and APP_DEBUG=0 in the container environment and restart:
Troubleshooting
Changes to Twig or PHP don't appear on refresh
Changes to Twig or PHP don't appear on refresh
- Verify worker mode is off in the active Caddyfile (
Caddyfile.devhas noworkerinsidephp_server). - Check that
config/packages/dev/twig.yamlsetstwig.cache: false. - Check that
docker/php-dev.iniis mounted and setsopcache.revalidate_freq=0. - Restart the container after changing the Caddyfile:
docker-compose restartormake -C demo/symfony8 restart. - Hard-refresh the browser (Ctrl+Shift+R) or try a private window.
Web Profiler or Twig Inspector not visible
Web Profiler or Twig Inspector not visible
-
Confirm
APP_ENV=devandAPP_DEBUG=1are set in the container. -
Ensure
WebProfilerBundle,DebugBundle, andNowoTwigInspectorBundleare enabled fordevinconfig/bundles.php. -
Clear the Symfony cache:
Demo doesn't respond or 'make up' times out
Demo doesn't respond or 'make up' times out
The Makefile runs
composer install and cache:clear in one-off containers before starting the server, then waits for an HTTP response on the configured port. Check that:- The port in
.env(defaultPORT=8001) is not already in use. - The container started successfully:
docker-compose logs php. - Required env vars such as
APP_SECRETare set.
Caddyfile changes have no effect
Caddyfile changes have no effect
The Caddyfile is read when FrankenPHP starts. Restart the container after any changes:In dev mode, the entrypoint copies
Caddyfile.dev over the default. Make sure you edited Caddyfile.dev and that it is mounted correctly.