laravel ext-imagick * -> 您的系统中缺少请求的 PHP 扩展 imagick

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35829419/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 13:21:03  来源:igfitidea点击:

ext-imagick * -> the requested PHP extension imagick is missing from your system

phplaravelimagickhomestead

提问by maesk

I have trouble installing devisephp for laravel. I am working on the latest version of homestead with php7. when i do composer update i get the following error.

我在为 laravel 安装 devisephp 时遇到问题。我正在使用 php7 开发最新版本的 homestead。当我做作曲家更新时,我收到以下错误。

Problem 1
    - Installation request for devisephp/cms 1.4.* -> satisfiable by devisephp/cms[1.4.0].
    - devisephp/cms 1.4.0 requires ext-imagick * -> the requested PHP extension imagick is missing from your system.

After having this message i installed imagick on my homestead environment added the extension to php.ini in cli and fpm and checked in homestead if imagick is working with a test file. Everything was working perfectly but on running composer update i still get the same error message from above. Does anyone have a clue what the problem can be.

收到这条消息后,我在我的 homestead 环境中安装了 imagick,在 cli 和 fpm 中将扩展添加到 php.ini 并检查了 homestead 如果 imagick 正在使用测试文件。一切正常,但在运行 composer update 时,我仍然从上面收到相同的错误消息。有没有人知道问题可能是什么。

The stange thing is that is kan git clone devisephp its bootstrap version completely working including image handling but when i add another package to laravel i again get the above message.

奇怪的是,kan git clone devisephp 它的引导程序版本完全可以工作,包括图像处理,但是当我向 laravel 添加另一个包时,我再次收到上述消息。

回答by Roman86

if you really can't install or don't want that extension to be validated you may skip it by supplying the

如果您确实无法安装或不想验证该扩展,则可以通过提供

--ignore-platform-reqs

--ignore-platform-reqs

flag to your composer command

标记到您的作曲家命令

回答by Manisha

Please follow these steps

请按照以下步骤操作

  • sudo apt-get install php-imagick
  • php -m | grep imagick// this should print 'imagick' it means installed correctly
  • sudo service apache2 restart//(if needed)
  • sudo apt-get install php-imagick
  • php -m | grep imagick// 这应该打印 'imagick' 这意味着安装正确
  • sudo service apache2 restart//(如果需要)

回答by Henry

Try adding:

尝试添加:

"ext-imagick": "*",

to your requireblock in your composer.json like so:

到您的 composer.json 中的require块,如下所示:

"license": "MIT",
"require": {
    "ext-imagick": "*",
    ....
}

and run composer update

并运行作曲家更新