Laravel - 未安装 Imagick
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26392726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel - Imagick not installed
提问by Lovelock
using Laravel and trying to work on image upload using Imagine.
使用 Laravel 并尝试使用 Imagine 处理图像上传。
The issue is that I get the error stating:
问题是我收到错误说明:
Imagine \ Exception \ RuntimeException
Imagick not installed
Open: /Applications/MAMP/htdocs/laravelcms/vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php
{
/**
* @throws RuntimeException
*/
public function __construct()
{
if (!class_exists('Imagick')) {
throw new RuntimeException('Imagick not installed');
}
I followed this guide, and correctly created all the folders and files etc as stated:
我遵循了本指南,并按照说明正确创建了所有文件夹和文件等:
http://creolab.hr/2013/07/image-manipulation-in-laravel-4-with-imagine/
http://creolab.hr/2013/07/image-manipulation-in-laravel-4-with-imagine/
I have also checked the the Imagick folder with all files etc is in the correct location.
我还检查了包含所有文件等的 Imagick 文件夹是否位于正确的位置。
Any help?
有什么帮助吗?
Thanks, Craig.
谢谢,克雷格。
回答by Lovelock
After some research, I found that MAMP 3 comes with Imagick pre-installed but not enabled by default.
经过一番研究,我发现 MAMP 3 预装了 Imagick,但默认情况下未启用。
Simply edit the php.ini file and search for:
只需编辑 php.ini 文件并搜索:
;extension=imagick.so
Remove the ';' before it.
去除那个 ';' 在它之前。
回答by cwallenpoole
The most likely cause is that you don't have Imagick installed. It does not come enabled on MAMP natively, so that is not surprising. There are instructions on how to add it to MAMP here.
最可能的原因是您没有安装 Imagick。它本身并没有在 MAMP 上启用,所以这并不奇怪。此处提供了有关如何将其添加到 MAMP 的说明。
回答by Marcel
If you have in fact installed it and it is still not working, a web server restart should do the trick. Cheers.
如果您实际上已经安装了它但它仍然无法正常工作,那么重新启动 Web 服务器应该可以解决问题。干杯。
回答by antongorodezkiy
Also for all other: do not forget that artisan
will probably use separate php.ini, so will need to include extension=imagick.so
there as well.
同样对于所有其他人:不要忘记它artisan
可能会使用单独的 php.ini,因此也需要包含extension=imagick.so
在那里。