我尝试在symfony 2中实现liipbundle。但当我将这个imagine_filter("umbnail")添加到图像中时,它会返回一个错误:
致命错误:在中找不到类"Imagine\Gd\Imagine"/home/piripz8g/public_html/app/cache/prod/appProdProjectContainer.php588 线上
这是我在配置文件中的代码:
liip_imagine:
resolvers:
default:
web_path: ~
filter_sets:
cache: ~
thumbnail:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
路由:
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.xml"
appKernel:
new LiipImagineBundleLiipImagineBundle(),
树枝:
{{ asset(f.path|imagine_filter('thumbnail')) }}
我想你忘了将捆绑包添加到app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new LiipImagineBundleLiipImagineBundle(),
);
// ...
}
// ...
}
似乎没有加载php5-gd。您可以通过键入以下命令来验证php5-gd是否已加载:
$ php5 -m | grep -i gd
如果未加载。。。
$ sudo apt-get install php5-gd
$ sudo service apache2 restart