Skip to content

Knowledgebase

Deploying Symfony in the production environment

development

A Symfony production deployment needs the correct dependencies, environment and public document root. Uploading a development directory without preparing its cache can leave debugging enabled or load the wrong services.

Check access and requirements

Confirm the PHP requirements of the selected Symfony branch, required extensions and database connectivity. Prepare a tested release and an authorised way to run its console commands.

01 Deploy Symfony in the production environment

  1. Upload the reviewed application and committed Composer lock file to a release directory. Install production dependencies with the selected PHP runtime and omit development packages unless a justified build step needs them.

  2. Configure the production environment with debug disabled. Most applications use APP_ENV=prod and APP_DEBUG=0; check any custom runtime bootstrap as well.

  3. Point the domain to the public directory. Keep configuration, source code, logs and dependency metadata outside direct web access.

  4. Clear and warm the production cache using the application console as the intended deployment account. Apply approved migrations separately and build the assets used by this application.

  5. Restart persistent message consumers after the release changes and confirm the supervisor launches them from the new path.

Confirm the expected result

Check a public page, an authenticated request, an asset and a database write. Inspect the private log and verify that debug pages or the development profiler are not publicly exposed.

Resolve setup problems

A cache warmup failure can indicate a missing extension, unresolved environment value or incompatible service definition. Correct the reported cause before switching the active release.

A common question

Can I upload my local cache directory to production?

Build the appropriate cache for the target environment through the supported release process. Local cached paths and development configuration are not a reliable substitute for production preparation.

Sources and further reading

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support