Imagemagick 未与 MAMP 一起安装

发布于 2024-07-30 18:45:48 字数 438 浏览 0 评论 0原文

所以我读了 这篇文章介绍了如何使用 MAMP 安装 Imagemagick,并且完全按照它所说的进行(sudo port install Imagemagick,一切都安装好了,然后更改 envvars 文件),但我仍然得到这个尝试运行使用它的脚本时出错:

Fatal error: Class 'Imagick' not found in /Applications/MAMP/htroots/active/includes/images.php on line 19

有谁知道为什么这对除了我之外的所有人都有效?

So I read this article on how to install Imagemagick with MAMP, and did exactly how it said, (sudo port install Imagemagick, everything installed okay, then change the envvars file), yet I still get this error when trying to run a script that uses it:

Fatal error: Class 'Imagick' not found in /Applications/MAMP/htroots/active/includes/images.php on line 19

Does anyone have any idea why this is working for seemingly everyone except me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拔了角的鹿 2024-08-06 18:45:48

您好,

这看起来 PHP 没有加载 Imagick 扩展。

如果您创建一个仅包含以下内容的 php 脚本:

<?php
phpinfo();
?>

您是否在输出中得到任何提及 Image magick 的内容(例如“imagick”部分)?

如果不是(考虑到您遇到的错误,情况可能就是这样),Image Magick 扩展可能未加载。

有两个想法,现在

  • 检查你的 php.ini 文件:它应该包含像“extension=imagick.ext”这样的行(不知道 mac 上的“ext”是什么,抱歉)
  • 你是否重新启动 apache 来让新扩展采用考虑到?
  • PHP/Apache 错误日志中是否有任何错误? 就像说 imagick 尚未加载和/或为什么?

HI,

This looks like the Imagick extension is not loaded by PHP.

If you create a php script that only contains this :

<?php
phpinfo();
?>

Do you get anything (like an "imagick" section) mentionning Image magick in the output ?

If not (that's probably the case, considering the error you're gettin), Image Magick extension probably isn't loaded.

Two ideas, now

  • Check you php.ini file : it should contain a line like "extension=imagick.ext" (don't know what "ext" is on a mac, sorry)
  • did you restart apache to have te new extension take into account ?
  • do you have any error in the PHP/Apache error log ? Like something that said imagick has not been loaded and/or why ?
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文