【问题标题】:Symfony 2.4 LiipImagineBundleSymfony 2.4 LiipImagineBundle
【发布时间】:2014-05-09 19:43:40
【问题描述】:

我安装了 LiipImagineBundle,看起来包安装正确。在我的模板中,我添加了以下行:

<img src="{{ asset('bundles/codecatsfront/images/python-bg.png') | imagine_filter('my_thumb') }}" alt="...">

但此网址存在服务器错误: http://pc.t/app_dev.php/media/cache/my_thumb/bundles/codecatsfront/images/python-bg.png

我的 python-bg.png 是 src/CodeCats/FrontBundle/Resources/public/images/ 链接到 web/codecatsfront/images。

我也试过命令:

app/console liip:imagine:cache:resolve php-bg.png

它可以工作,我对这个捆绑包的附加配置:

liip_imagine:
    resolvers:
       default:
          web_path: ~

    filter_sets:
        cache: ~
        my_thumb:
            quality: 75
            filters:
                thumbnail: { size: [120, 90], mode: outbound }

【问题讨论】:

  • 错误是什么样的?你安装了什么网络服务器?
  • 500 内部服务器错误,Ubuntu 14.04 上的 Apache2
  • 您收到什么错误信息?也许 apache 日志文件中写的是什么?
  • 日志里没找到,应该配置htaccess吧?
  • 你有静态资产的apache配置吗?

标签: php symfony liipimaginebundle


【解决方案1】:

你应该去掉“asset()”函数。

<img src="{{ 'bundles/codecatsfront/images/python-bg.png' | imagine_filter('my_thumb') }}" alt="...">

解决了吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 2014-11-04
    • 2014-06-09
    • 1970-01-01
    • 2023-03-19
    • 2018-09-14
    相关资源
    最近更新 更多