Volver a las plantillas
symfony icon

Symfony Starter

A Symfony 7.4 LTS skeleton on PHP 8.3 with an HTML page and a JSON endpoint.

preview of Symfony Starter

Symfony starter for Wasmer Edge

A Symfony 7.4 (LTS) skeleton on PHP 8.3 with an HTML page and a JSON endpoint, running on Wasmer Edge.

After catalog registration, deploy this template from the Wasmer templates page.

How it works

  • src/Controller/HomeController.php serves / and /api/hello with attribute routes.
  • .env sets APP_ENV=prod. For local development, create .env.local with APP_ENV=dev.
  • The Wasmer build runs composer dump-env prod --empty, so the deployed app boots in prod without debug and reads only real environment variables and secrets. It does not need .env, which wasmer deploy skips when uploading a folder.
  • Wasmer installs Composer dependencies and serves public/index.php.

Configuration

Set an APP_SECRET secret on your app before you add forms, sessions or login.

Run it locally

composer install
echo 'APP_ENV=dev' > .env.local
php -S localhost:8000 -t public

Then open http://localhost:8000/.

Catalog registration follows source merge; this PR does not publish the catalog entry. Dependencies are locked in composer.lock; run composer update --no-install after changing composer.json and commit the updated lockfile.

Shared UI

The landing page uses the framework-neutral Wasmer starter components documented in _shared/starter-ui/DESIGN.md. Run node scripts/sync-starter-ui.mjs --check php-symfony-starter/public/starter-ui.js from the repository root to check the generated copy.

Set APP_SECRET to a unique random secret before adding sessions, signed links or other security features. The framework has lazy session support, but this starter’s routes do not use sessions or signed links. No shared development secret is committed.

Build with Anybuild

Use Anybuild 0.33.3. Both recipes copy the selected source before installing dependencies, because Symfony Flex updates its Composer manifest.

From this repository root:

anybuild auto . --docker --wasmer --subdir php-symfony-starter --start --serve-port 8938

Or from php-symfony-starter/:

anybuild auto . --docker --wasmer --start --serve-port 8939
Frameworksymfony
Languagephp
Browse all templates →
Symfony Starter · Wasmer