zoukankan      html  css  js  c++  java
  • ZH奶酪:PHP安装扩展imagick

    明明几个简单命令就能搞定,但是按照网上的方法就是不行,弄了一天,最后发现只需要两行命令,而且不需要修改什么php.ini:

    sudo apt-get install php5-imagick
    sudo service apache2 reload

     网上的其他方法:

    (1)7个步骤:链接:http://stackoverflow.com/questions/3790191/php-error-class-imagick-not-found

    sudo apt-get update    //Update libraries and packages
    sudo apt-get autoremove    Remove obsolete things    
    sudo apt-get install libmagickwand-dev    //For the libraries of ImageMagick
    sudo apt-get install imagick    //For the core class Imagick
    sudo pecl install imagick    //For create the binaries and conections in beetween
    sudo echo "extension=imagick.so" >> /etc/php5/apache2/php.ini    //Append the extension to php.ini
    sudo service apache2 restart    //Restart Apache

    PS:PHP在/usr/lib/php5/20102525目录中搜索.so文件,但是imagick.so在文件/usr/lib/php5/20090626中。因此需要讲so文件赋值到php搜索的目录中。

    (2)5个步骤:

    链接:https://news.ycombinator.com/item?id=1726074

    yum install ImageMagick.i386
    yum install ImageMagick-devel.i386
    pecl install imagick
    echo "extension=imagick.so" > /etc/php.d/imagick.ini
    service httpd restart 

    PS:上边的方法适用于使用yum包管理工具的i386系统(32位),在x86_64系统(64位)中需要把.i386修改为.x86_64

    (3)4个步骤:Ubuntu

    sudo apt-get install php5-dev pecl imagemagick libmagickwand-dev
    sudo pecl install imagick
    sudo apt-get install php5-imagick
    sudo service apache2 restart

    这是一个比较完整的PHP使用Imagick扩展的安装流程。

  • 相关阅读:
    简单svg动画
    如何开发jQuery插件
    Nodejs的模块系统以及require的机制
    Nodejs的http模块
    DOM详解
    利用powershell进行远程服务器管理(命令行模式)
    关于storm群集容错概念的简单介绍
    powershell利用winform批量执行tsql语句
    nginx往后端转发时需要注意的两个问题
    解决hyerv的linux虚拟机网卡地址重启发生变化的问题
  • 原文地址:https://www.cnblogs.com/CheeseZH/p/4563029.html
Copyright © 2011-2022 走看看