简体   繁体   English

在 Mac 上为 XAMPP 安装 ImageMagick

[英]Install ImageMagick for XAMPP on Mac

I'm using xampp to do some localhost tests of my PHP projects, but just realized that I'm missing the Imagick package.我正在使用 xampp 对我的 PHP 项目进行一些本地主机测试,但刚刚意识到我错过了 Imagick package。 I've searched around and cannot find a set of instructions (dumbed down to my level) to install ImageMagick.我四处搜索,找不到安装 ImageMagick 的一组说明(降低到我的水平)。

I followed a tutorial involving MacPorts only to find out later that you can install it via PECL within xampp (whatever that means).我遵循了一个涉及 MacPorts 的教程,后来才发现你可以通过 PECL 在 xampp 中安装它(不管那是什么意思)。

    cd /Applications/xampp/xamppfiles/bin/
    pecl download imagick

Running the above resulted in:运行上述结果:

    invalid package name/package file "imagick"
    download failed

I'm a web coder with embarrassingly ZERO server-type skills.我是 web 编码员,具有令人尴尬的零服务器类型技能。 Any help is MUCH appreciated.任何帮助深表感谢。 I think I read something about needing the devel version of xampp.我想我读到了一些关于需要 xampp 的开发版本的信息。 Could that be my problem?这可能是我的问题吗? And how would I know if that's what I've got?我怎么知道这就是我所拥有的?

Mac Verion 10.6.7 Xampp version 1.7.3 Mac 版本 10.6.7 Xampp 版本 1.7.3

What are the results of executing执行的结果是什么

$ pecl search imagick

I just downloaded XAMPP to test this, and had the following results:我刚刚下载了 XAMPP 进行测试,结果如下:

mlambie@destro:/Applications/XAMPP/xamppfiles/bin$ ./pecl search imagick
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
imagick 3.1.0b1 (beta)        Provides a wrapper to the ImageMagick library.

Note that whilst pecl can see the package, attempting to install it with $ pecl install imagick failed with the following error:请注意,虽然 pecl 可以看到 package,但尝试使用$ pecl install imagick安装它失败并出现以下错误:

ERROR: `/Applications/XAMPP/xamppfiles/temp/pear/temp/imagick/configure --with-imagick' failed错误:`/Applications/XAMPP/xamppfiles/temp/pear/temp/imagick/configure --with-imagick' 失败

This is because I do not have the ImageMagick libraries installed on my machine.这是因为我的机器上没有安装 ImageMagick 库。 I rectified that with:我纠正了这一点:

$ brew install imagemagick

(I use homebrew instead of MacPorts to manage this kind of thing). (我使用自制软件而不是 MacPorts 来管理这种事情)。

I was still missing the PHP headers, which I installed using the XAMPP Developer Package.我仍然缺少 PHP 标头,我使用 XAMPP Developer Package 安装了它。 I downloaded and installed this from the same location where I downloaded XAMPP from.我从下载 XAMPP 的同一位置下载并安装了它。 Note that the Developer Package is a separate DMG entirely.请注意,Developer Package 完全是一个单独的 DMG。

Once that was done, I successfully compiled the module with:完成后,我成功编译了模块:

$ pecl install imagick

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM