Install php imagick extension on CentOS

03 Mar 2014


  1. Download souce code

    wget http://pecl.php.net/get/imagick-3.1.2.tgz
    tar xzfv imagick-3.1.2.tgz 
    cd imagick-3.1.2
    
  2. Install ImageMagick-devel first.

    yum install ImageMagick-devel
    
  3. Build

    phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config 
    make
    make install
    
  4. Copy imagick.so to extension directory.

    If you do not know the path, find it out by (or change it in php.ini):

    php -i | grep "extension_dir"
    

    Then, edit php.ini, add extension=imagick.so.

    If you run php in a webserver, restart the it, for example:

    sudo service httpd restart
    
  5. Done.


The motto:

  • Quick money is not the solution.

  • You must plan ahead.

  • You should see the bigger picture.


comments powered by Disqus