symfony - 500 internal server error - IOException: Failed to create media/cache/my_thumb with LiipImagineBundle -
i trying apply filter on image based on liipimaginebundle.
here steps:
installation through composer file adding line:
"liip/imagine-bundle": "1.0.*@dev"
configuration of config.yml file adding these lines:
liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: media/cache filter_sets: cache: ~ my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound }
declaration of bundle in appkernel.php:
new liip\imaginebundle\liipimaginebundle(),
testing bundle adding there line twig file:
<img src="{{ asset('img/test.jpg') | imagine_filter('my_thumb') }}" />
but, no image displayed. generated html file contains:
<img src="http://localhost/tuto/web/app_dev.php/media/cache/my_thumb/img/test.jpg">
and in javascript console of browser, find error:
get http://localhost/tuto/web/app_dev.php/media/cache/my_thumb/img/test.jpg 500 (internal server error)
when try open link (with 500 internal server error), symfony throws error:
failed create /home/amine/netbeansprojects/tuto/app/../web/media/cache/my_thumb/img 500 internal server error - ioexception
i guess not have permission create following folder: /home/amine/netbeansprojects/tuto/app/../web/media/cache/my_thumb/img
. in point of view, expectable since working on ubuntu.
to avoid problem, directly changed permissions on folder web
through sudo chmod 777 -r web
problem still same.
is there idea?
the problem solved. changed config.yml this:
liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web/imagine # imagine folder filtered images created! cache_prefix: tuto/web/imagine/media/cache # tuto folder of symfony application filter_sets: cache: ~ my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound }
and twig part, has been changed to:
<img src="{{ 'img/test.jpg' | imagine_filter('my_thumb') }}" /> {# img folder put images!#}
my question is: possible change configuration of parameter cache_prefix
in way replace tuto
else in order have configuration works anywhere? asking question because avoid problems when hosting web site!
thanks...
Comments
Post a Comment