Symfony, Liip Imagine, not running on the server in prod

I have a project in which I save my uploaded images to src / My / Bundle / Resources / uploads / images / full and use the imagine_filter twig imagine_filter to dynamically create thumbnails.

It runs flawlessly on my local machine, and this happens on my server, but only in the dev environment. When I delete previously created thumbnails (leaving only the full directory), clear the cache file and load any web page, the images are not created, their url always remains under the media / cache, and the registrar gives me request.ERROR :

 "No route found for "GET /uploads/images/avatar/354026c94b773b77ca945b4a6323e15c84102f6b.jpg"" at /<path>/app/cache/prod/classes.php line 1964 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /uploads/images/avatar/354026c94b773b77ca945b4a6323e15c84102f6b.jpg\" at /<path>/app/cache/prod/classes.php:1964, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException: at /<path>/app/cache/prod/appProdUrlMatcher.php:1816 

Additional Information:

  • I have symlinked src / My / Bundle / Resources / uploads to web / uploads
  • my config is ( thumbnail_min - custom filter): liip_imagine: loaders: default: filesystem: data_root: %kernel.root_dir%/../web/uploads/images/full resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: /uploads/images cache: default filter_sets: avatar: quality: 90 filters: thumbnail_min: { size: 50, mode: inset } .... full: quality: 100
  • permissions are always no less than the rw group (which is necessary on the server)
+6
source share
1 answer

It just had a similar problem on my local machine, however it is still in the dev environment.

For me, I did not have permission for the group to access the folder with the default media cache, which remained empty after the linden tree: imagine: cache: remove and page reload. Thus, the images were associated with an empty folder.

To fix, I first made sure that the group was set to Apache _www (mac) / www-data (linux), for example.

  • sudo chgrp -R www-data web / media / cache

Then make sure the folder is set to read, write and execute, for example.

  • sudo chmod -R g + rwx web / media / cache

Hope this helps ...

0
source

Source: https://habr.com/ru/post/971280/


All Articles