【问题标题】:php error installing imagickphp错误安装imagick
【发布时间】:2019-01-23 08:39:33
【问题描述】:

系统 - CentOS 7.5.1804

PHP 版本 - 7.0.3

所以,我正在尝试安装 Imagick,以便能够在 PDF 的第一页上渲染/制作图像。

我试图了解它是如何设置的,但我遗漏了一些东西,所以我将重现我所拥有的以及到目前为止所拥有的:

经过一长串错误后,我选择了这 4 个安装:

sudo rpm -Uvh ImageMagick-7.0.8-9.x86_64.rpm
sudo rpm -Uvh ImageMagick-libs-7.0.8-9.x86_64.rpm 
sudo yum install php70-php-pecl-imagick.x86_64
sudo php go-pear.phar

当我尝试运行此程序时:sudo /usr/bin/pecl install imagick,它给了我以下错误:

警告:频道“pecl.php.net”已更新其协议,请使用“pecl channel-update pecl.php.net”更新 正在下载 imagick-3.4.3.tgz ... 开始下载imagick-3.4.3.tgz (245,410 bytes) .............................完成:245,410 字节 19个源文件,构建 运行:phpize 在 /usr/include/php 中找不到 PHP 头文件 使用此命令需要 php-devel 包。 错误:`phpize' 失败

所以,在检查 'php-devel' 有点不在这里之后,我尝试安装它,我得到了这个:

错误:包:php-pecl-jsonc-devel-1.3.10-2.el7.remi.5.6.x86_64 (remi-php56) 要求:php-pecl-jsonc(x86-64) = 1.3.10-2.el7.remi.5.6 可用:php-pecl-jsonc-1.3.10-1.el7.remi.5.6.x86_64 (remi-php56) php-pecl-jsonc(x86-64) = 1.3.10-1.el7.remi.5.6

错误:包:php-pecl-jsonc-1.3.10-2.el7.remi.5.6.x86_64 (remi-php56)

要求:php(zend-abi) = 20131226-64

已安装:php-common-7.0.31-1.el7.remi.x86_64 (@remi-php70) php(zend-abi) = 20151012-64 可用:php-common-5.4.16-45.el7.x86_64(基础) php(zend-abi) = 20100525-64 可用:php-common-5.6.36-1.el7.remi.x86_64 (remi-php56) php(zend-abi) = 20131226-64 可用:php-common-5.6.37-1.el7.remi.x86_64 (remi-php56) php(zend-abi) = 20131226-64

错误:包:php-devel-5.6.37-1.el7.remi.x86_64 (remi-php56)

要求:php-cli(x86-64) = 5.6.37-1.el7.remi

已安装:php-cli-7.0.31-1.el7.remi.x86_64 (@remi-php70) php-cli(x86-64) = 7.0.31-1.el7.remi 可用:php-cli-5.4.16-45.el7.x86_64(基础) php-cli(x86-64) = 5.4.16-45.el7 可用:php-cli-5.6.36-1.el7.remi.x86_64 (remi-php56) php-cli(x86-64) = 5.6.36-1.el7.remi 可用:php-cli-5.6.37-1.el7.remi.x86_64 (remi-php56) php-cli(x86-64) = 5.6.37-1.el7.remi

错误:包:php-pecl-jsonc-1.3.10-2.el7.remi.5.6.x86_64 (remi-php56)

要求:php(api) = 20131106-64

已安装:php-common-7.0.31-1.el7.remi.x86_64 (@remi-php70) php(api) = 20151012-64 可用:php-common-5.4.16-45.el7.x86_64(基础) php(api) = 20100412-64 可用:php-common-5.6.36-1.el7.remi.x86_64 (remi-php56) php(api) = 20131106-64 可用:php-common-5.6.37-1.el7.remi.x86_64 (remi-php56) php(api) = 20131106-64

我做错了什么/我错过了什么?

【问题讨论】:

标签: php linux centos7 imagick


【解决方案1】:

您可以使用 remi php 存储库轻松安装和维护您的服务器。

首先从以下地址下载 remi-release rpm 文件:

http://remi.schlundtech.de/enterprise/remi-release-7.rpm

然后,运行:

sudo rpm -Uvh remi-release-7.rpm

编辑文件remi.repo : sudo vim /etc/yum.repos.d 并确保[remi] 部分中enabled 的值是1。

[remi]
#some configurations
enabled=1

现在使用此命令,您可以安装每个版本的 php 以及您需要的任何扩展。

sudo yum install php70-php php70-php-imagick

【讨论】:

  • 我已经安装了这些,但问题仍然存在。我该怎么做才能使用 Imagick?
  • 转到目录/etc/yum.repos.d 并检查ls 命令的结果,告诉我你看到的列表。
  • 您是否在remi.repo 文件中启用了remi repo?
【解决方案2】:

为我奔跑

yum install ImageMagick ImageMagick-devel

然后运行

pecl install imagick

解决了这个问题。我使用的是 CentOS 7 服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-06
    • 2016-04-14
    • 1970-01-01
    • 2012-01-29
    • 2018-11-14
    • 2015-10-25
    • 2012-05-16
    • 1970-01-01
    相关资源
    最近更新 更多