如何:在 Ubuntu 11.10 上安装 Imagick(用于 php)

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

Howto: Install Imagick (for php) on Ubuntu 11.10

phpimagickpecl

提问by DJSunny

I'm attempting to install ImagicK as its required for a Yii Extension I want to use for my project.

我正在尝试将 ImagicK 安装为我想用于我的项目的 Yii 扩展所必需的。

I've checked around and followed a few different suggestions but nothing that has worked so far, ultimately the framework extension is still throwing me an error (Must have ImagicK installed).

我已经检查并遵循了一些不同的建议,但到目前为止没有任何效果,最终框架扩展仍然给我一个错误(必须安装 ImagicK)。

I've tried things like:

我试过这样的事情:

sudo apt-get update
sudo apt-get install imagick-php5 .. etc

as well as the PECL install which ends up throwing me the following error:

以及最终给我抛出以下错误的 PECL 安装:

Checking ImageMagick MagickWand API configuration program... configure: error: 
not found. Please provide a path to MagickWand-config or Wand-config program. 

Any help as to how to get ImagicK installed and integrated with PHP on Ubuntu 11.10 would be great.

关于如何在 Ubuntu 11.10 上安装 ImagicK 并与 PHP 集成的任何帮助都会很棒。

Thanks in advance!

提前致谢!

回答by mario

The package has a different name in Ubuntu.

该软件包在 Ubuntu 中具有不同的名称。

 sudo apt-get install php5-imagick

The error with building via PECL means you must install libmagickwand-dev, libmagickcore3, libmagickwand3probably (there are alternatives: graphicsmagick-imagemagick-compat, see Synaptic).

通过 PECL 构建的错误意味着您libmagickwand-dev, libmagickcore3, libmagickwand3可能必须安装(有替代方法:graphicsmagick-imagemagick-compat,请参阅 Synaptic)。

回答by Sumoanand

Installation steps for Ubuntu 12.04:

Ubuntu 12.04 的安装步骤:

  1. Install imagemagick

    sudo apt-get install imagemagick

  2. Install imagemagick PECL extension

    sudo apt-get install php5-imagick

  3. Restart webserver

  1. 安装 imagemagick

    sudo apt-get 安装 imagemagick

  2. 安装 imagemagick PECL 扩展

    sudo apt-get install php5-imagick

  3. 重启网络服务器

回答by bdombro

Installation steps for Ubuntu < 16.04:

Ubuntu < 16.04 的安装步骤:

sudo apt-get install imagemagick php5-imagick; sudo service apache2 restart

Installation steps for Ubuntu > 16.04:

Ubuntu > 16.04 的安装步骤:

sudo apt-get install imagemagick php-imagick; sudo service apache2 restart

回答by Karl Wolf

For Ubuntu 16 or later:

对于 Ubuntu 16 或更高版本:

sudo apt-get install php-imagick

(note the use of php-instead of php5-)

(注意使用php-代替php5-

回答by Ravi Sharma

Install imagemagick with :

使用以下命令安装 imagemagick:

sudo apt-get install imagemagick

Install imagemagick PECL extension :

安装 imagemagick PECL 扩展:

sudo apt-get install php5-imagick

Restart webserver

重启网络服务器

回答by AZinkey

With Ubuntu 16.04 (Xenial) with PHP 5.6 not 7. PHP 7 was disabled.

使用 Ubuntu 16.04 (Xenial) 和 PHP 5.6 而不是 7。PHP 7 被禁用。

  1. sudo apt-get update
  2. sudo apt-get install imagemagick php5.6-imagick
  1. sudo apt-get 更新
  2. 须藤 apt-get 安装 imagemagick php5.6-imagick