php error: Class 'Imagick' not found

前端 未结 8 962
夕颜
夕颜 2020-12-08 13:20

I am getting the error \"Class \'Imagick\' not found\". Somehow I need to make this library accessible to php. I am using Php 5.2.6 on Fedora 8. my php_info has no mention

相关标签:
8条回答
  • 2020-12-08 13:25

    For all to those having problems with this i did this tutorial:

    How to install Imagemagick and Php module Imagick on ubuntu?

    i did this 7 simple steps:

    Update libraries, and packages

    apt-get update
    

    Remove obsolete things

    apt-get autoremove
    

    For the libraries of ImageMagick

    apt-get install libmagickwand-dev
    

    for the core class Imagick

    apt-get install imagemagick
    

    For create the binaries, and conections in beetween

    pecl install imagick
    

    Append the extension to your php.ini

    echo "extension=imagick.so" >> /etc/php5/apache2/php.ini
    

    Restart Apache

    service apache2 restart
    

    I found a problem. PHP searches for .so files in a folder called /usr/lib/php5/20100525, and the imagick.so is stored in a folder called /usr/lib/php5/20090626. So you have to copy the file to that folder.

    0 讨论(0)
  • 2020-12-08 13:25

    From: http://news.ycombinator.com/item?id=1726074

    For RHEL-based i386 distributions:

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

    This may also work on other i386 distributions using yum package manager. For x86_64, just replace .i386 with .x86_64

    0 讨论(0)
  • 2020-12-08 13:30

    Docker container installation for php:XXX Debian based images:

    RUN apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev
    RUN pecl install imagick && docker-php-ext-enable imagick
    RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true
    
    0 讨论(0)
  • 2020-12-08 13:33

    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
    

    Some dependencies will probably already be met but excluding the Apache service, that's everything required for PHP to use the Imagick class.

    0 讨论(0)
  • 2020-12-08 13:39

    For MAMP running on Mac OSX

    Find out the what version of PHP and install the right version via brew

    brew install homebrew/php/php56-imagick
    

    Add the extension by modifying the php.ini template in MAMP

    Verify the Imagick

    0 讨论(0)
  • 2020-12-08 13:40

    Debian 9

    I just did the following and everything else needed got automatically installed as well.

    sudo apt-get -y -f install php-imagick
    sudo /etc/init.d/apache2 restart
    
    0 讨论(0)
提交回复
热议问题