Symfony
What Gigadrive Network detects for a Symfony project, which PHP runtime it uses, and the secret you have to set yourself.
Gigadrive Network detects Symfony when your composer.json requires symfony/framework-bundle and a bin/console file exists at the project root. Both have to match. public/index.php becomes the Function that answers every path.
Set APP_SECRET yourself
Symfony needs APP_SECRET for CSRF tokens, signed URLs and session integrity, and nothing sets it for you. The preset
names a placeholder in the configuration it generates, and config-file environment variables are accepted and not
applied, so the variable is absent until you store a real value under Environment
variables on the application.
Defaults
| Setting | Value |
|---|---|
| Runtime | php-84 |
| Memory | 512 MB |
| Max duration | 30 seconds |
| Entrypoint | public/index.php |
| Route | /* to the entrypoint |
| Assets | public |
| Excluded | tests/*, .ddev, var |
The preset also names APP_ENV=prod, APP_DEBUG=false and MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 alongside the placeholder secret, and those go the same way: they sit in the generated configuration and no Function ever sees them. Store whichever of them your application relies on.
Runtimes and how requests are served
The available PHP runtime identifiers are php-84, php-83 and php-81. Symfony defaults to php-84.
Every request runs public/index.php as a front controller, so $_SERVER['SCRIPT_NAME'] is /index.php and the request path arrives in PATH_INFO the way PHP-FPM presents it. Symfony's Runtime component and router take it from there.
That front controller is the only route the preset creates, so a request for a compiled stylesheet reaches PHP too. The preset also walks public after the build and publishes everything else inside it, so AssetMapper or Encore output reaches the edge with no configuration of your own.
public/index.php is dropped from the published set because it is also the Function entrypoint, and every other .php, .phtml or .phar file under public is skipped as well: an exact-path asset route would otherwise outrank the front controller's wildcard route and serve that file's source instead of running it.
PHP responses are not streamed, so the whole response is buffered before it is sent. A fatal that produces no response at all is returned as 502 with the PHP error written to the logs rather than as an empty 200.
The build and the cache directory
The build runs composer install --no-interaction from the repository root whenever a composer.lock is there. JavaScript dependencies are installed separately, from whichever lockfile the repository carries, and a build script in package.json runs after them. That covers AssetMapper and Encore front ends.
var/ is excluded from the deployed package, so nothing written there during the build ships with the Function. Symfony's cache and log directories are the usual casualty. Override getCacheDir() and getLogDir() in your Kernel to point under /tmp, which is the writable path a Function has at request time.
Changing the defaults
version: 4
functions:
public/index.php:
runtime: php-83
memory: 1024
max_duration: 60Declaring the Function replaces the preset's entrypoint, and any setting you omit falls back to the config file's own defaults of memory: 128 and max_duration: 30 instead of the preset's 512 MB. Set both explicitly.
Symfony's own documentation lives at symfony.com/doc.
