Symfony projects may use AssetMapper, a JavaScript build tool or directly managed public assets. The correct deployment step depends on the asset system installed in the project.
IN THIS ARTICLE
What you need before you begin
Inspect the repository for its asset configuration and build scripts. Identify the final public directory and whether the site is served at the domain root or below a path prefix.
01 Serve Symfony assets from the correct public directory
Run the asset build or compilation command documented by the application. Use its lock files and supported build runtime rather than installing arbitrary latest frontend packages on the server.
Include the generated public files and any asset manifest in the same release as the code that references them. Keep dependency source directories outside the document root.
Configure the web server to serve existing public assets directly and send application routes to the front controller. Check any URL prefix or CDN configuration.
Use versioned asset names or the project-supported cache-busting mechanism. Keep old assets long enough for already-open pages when a deployment changes filenames.
Publish the release and inspect the browser network panel for CSS, JavaScript, font and image responses.
Confirm the expected result
Confirm assets return their proper content and MIME types rather than an HTML error page. Open a fresh page and test an already-open page across a controlled deployment.
Troubleshoot unexpected results
If pages are unstyled, compare generated filenames with the active manifest and document root. A 200 response containing the application HTML is still a failed asset request.
A common question
Does uploading the assets source directory complete deployment?
Not when the project requires compilation or a manifest. Deploy the output expected by the selected asset system and keep its build process repeatable.