imagemagick在centos中安装问题 [英] imagemagick install problems in centos
问题描述
我正在尝试通过此网址在我的服务器上安装imagemagick(centos 7.1 minimal):
imagemagick安装步骤
i'm trying to install imagemagick on my server (centos 7.1 minimal) by this url: imagemagick installation steps
在步骤1中出现此错误:
get this error in step 1:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.de.leaseweb.net
* epel: mirrors.n-ix.net
* extras: mirror.de.leaseweb.net
* remi: remi.schlundtech.de
* remi-php55: remi.schlundtech.de
* remi-php56: remi.schlundtech.de
* remi-safe: remi.schlundtech.de
* remi-test: remi.schlundtech.de
* updates: mirror.de.leaseweb.net
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package php-devel available.
No package php-pear available.
Nothing to do
推荐答案
因为这个项目有在很多网站上受到质疑,我完全解释了安装过程...
这个过程在centos 6.5和php56以及imagick-3.4.3(ImageMagick-7)上测试
更改需要更改的任何部分的安装过程,如php版本或文件夹。
你可以在 ImageMagick版本
;使用持续稳定的版本。
如果您已多次安装ImageMagick,请首先删除所有这些并找到ImageMagick& 想象文件夹&文件并清理所有文件并继续安装过程。
Because this item has been questioned on many sites, I fully explain the installation process...
this proccess tested on centos 6.5 and php56 and imagick-3.4.3(ImageMagick-7)
Change the installation process for any part that needs to be changed like as your php version or folder.
you can find lasted version of "ImageMagick" in ImageMagick versions
; use lasted stable version.
If you have already installed "ImageMagick" several times, first remove all of them and find "ImageMagick" & "imagick" folders & files and clean all of them and continue the installation process with this process.
# yum remove ImageMagick ImageMagick-devel
使用以下命令查找文件或文件夹:
Use the following command to find a file or folder:
# find / -name 'ImageMagick*'
# find / -name 'imagick*
查找并删除显示的所有文件和文件夹
Find and delete all the files and folders that are displayed
开始安装php-pear:
确保安装了php-pear,稍后将用于安装Imagick PHP模块。
如果您没有梨,可以使用百胜安装:
Start Installation php-pear:
Ensure you have php-pear installed, which will be used later to install Imagick PHP module.
If you don’t have pear, you can install using Yum:
# yum install php-pear
如果您看到以下错误:
没有包php-梨可用。
错误:无所事事
solation:
If you see the following error:
No package php—pear available.
Error: Nothing to do
solation:
# cd /etc/
并打开yum.conf
and open yum.conf
或
# nano /etc/yum.conf
然后找到并删除php *并保存文件
And then find and remove php* and save file
然后输入:
# yum install --enablerepo remi php-pear php-devel
测试成功安装:
类型:
for test success Installation: type:
# yum info php-pear
结果是这样的:
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* epel: yum.ds.stackexchange.com
stack-local-prod | 2.9 kB 00:00
Available Packages
Name : php-pear
Arch : noarch
Epoch : 1
Version : 1.9.4
Release : 4.el6
Size : 393 k
Repo : base
Summary : PHP Extension and Application Repository framework
URL : http://pear.php.net/package/PEAR
License : BSD and PHP and LGPLv2+
Description : PEAR is a framework and distribution system for reusable PHP
: components. This package contains the basic PEAR components.
开始安装ImageMagick:
Start Installation ImageMagick:
# yum install ImageMagick
# yum install ImageMagick-devel
# pecl install Imagick
重要提示:将ImageMagick文件夹从/ usr / include复制到/ usr / local / include,以便ImageMagick找到 MagickWand.h
Important: copy "ImageMagick" folder from "/usr/include" to "/usr/local/include" for ImageMagick find "MagickWand.h"
# cd /usr/include
# cp ImageMagick /usr/local/include
在下面的行之前不要忘记:转到php.ini找到disable_functions并清除proc_open, popen,proc_closebecuase make imagick需要这些功能,完成安装后你可以将这些功能添加到php.ini文件中的disable_functions。
before below lines don't forget: go to "php.ini" find "disable_functions" and clean "proc_open,popen,proc_close" becuase make imagick needs these functions, after complete installation you can add this functions to your "disable_functions" on "php.ini" file.
继续:
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-3.4.3.tgz
# tar xzfv imagick-3.4.3.tgz
# cd imagick-3.4.3
# phpize
# ./configure --with-php-config=/usr/local/php56/bin/php-config
# make
# make install
copy安装共享扩展:/ usr / local / php56 / lib / php / extensions / no-debug-non-zts-20131226 /这是扩展名dir
将imagick.so从/ usr / local / php56 / lib / php / extensions / no-debug-non-zts-20131226 /复制到/ usr / local / php56 / lib / php / extensions /扩展目录。
copy Installing shared extensions: "/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/" this is extension dir
Copy "imagick.so" from "/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/" to "/usr/local/php56/lib/php/extensions/" extension directory.
# cd /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
# cp imagick.so /usr/local/php56/lib/php/extensions/
然后,编辑php.ini,找到动态扩展,在空行中添加extension = imagick.so,不要忘记服务器上有2个或更多php.ini,你可以找到所有其中:
Then, edit "php.ini", find "Dynamic Extensions" add extension=imagick.so in a empty line, don't forget there are 2 or more "php.ini" on your server, you can find all of them:
# find / -name 'php.ini'
结果可能是这样的
/etc/php.ini
/usr/local/php56/lib/php.ini
在此处使用此文件人l阶段:
Use this file at all stages:
/usr/local/php56/lib/php.ini
测试成功安装:
# php -m | grep imagick
结果应为: imagick
查找所有php函数和扩展使用:
for find all php functions and extensions use :
# php -m
现在你可以在显示列表中找到imagick
不要忘记:
编辑php.ini,找到disable_functions并将proc_open,popen,proc_close添加到disable_functions以获得服务器安全性!
now you can find "imagick" at showed list
Don't forget:
edit "php.ini", find "disable_functions" and add "proc_open,popen,proc_close" to disable_functions For server security!
现在重启你的服务器
# reboot
在php上安装测试游戏,在php文件中使用此代码:
for test imagick installation on php, use this code at php file:
if(extension_loaded('imagick')) {
$imagick = new Imagick();
print_r($imagick->queryFormats());
}
else {
echo 'imagick is not available.';
}
或使用
echo phpinfo();
这篇关于imagemagick在centos中安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!