Symfony asset image not found

  assets, php, symfony, symfony5

I would like to display an image on my page, like this:

<img src="{{ asset('image.png') }}"/>

The image is located in assets/image.png

If I open the page, the result is this:

<img src="/image.png"/>

But the image can not be found on that url.
I suspect, that the image.png has to be copied somehow to the /public directory, but Symfony did not copy it there, and I have no idea which command to run, to automatically copy the required assets like that.

Source: Symfony Questions

LEAVE A COMMENT