Install php extension imagick and gmagick in Ubuntu and how to report errors

Source: Internet
Author: User
In addition to the gd Library, php can process images, as well as imagick and gmagick. To install these two extensions as required by the project, record the installation process. You cannot install the gmagick extension library directly through apt-get, but you can install it using pecl. 1. sudoapt-getinstallgraphicsmagicklibgraph

In addition to the gd Library, php can process images, as well as imagick and gmagick. To install these two extensions as required by the project, record the installation process.

Install the gmagick Extension Library

This library cannot be directly installed through apt-get, but it can be installed using pecl.

1. sudo apt-get install graphicsmagick libgraphicsmagick1-dev2. sudo pecl install gmagick3. "extension = gmagick. so "write file/etc/php/conf. d/gmagick. ini4. restart web server, sudo/etc/init. d/apache2 restart

Tip: pecl is a php Extension Library. you can install it through sudo apt-get install php-pear. if the following error occurs:

Failed to download pecl/gmagick within preferred state "stable", latest release is version 1.1.1RC1, stability "beta", use "channel: // pecl.php.net/gmagick-1.1.1rc1" to install

The download fails. use the address "channel: // pecl.php.net/gmagick-1.1.1rc1" to install it.

sudo pecl install channel://pecl.php.net/gmagick-1.1.1RC1

If the error message shows that phpize is not found, you can install php-devel through apt-get install (or yum install php-devel.

If graphicsmagick and gmagick are compiled and installed, the following error occurs during installation:

Build Error: /usr/bin/ld: /usr/local/lib/libGraphicsMagickWand.a(drawing_wand.o):relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object;recompile with -fPIC

Use./configure -- enable-shared when compiling and installing graphicsmagick.

The following prompt appears during installation: Please provide the prefix of GraphicsMagick installation [autodetect]
You can directly press enter or use apt-file search GraphicsMagick-config to find the directory, enter the result, and press enter.

If the problem persists, we recommend that you compile and install GraphicsMagick and PHP extension gmagick in Linux.

Print phpinfo (). The following sections on the page indicate that the installation is successful:

Install the imagick Extension Library

You can install it directly through the sudo apt-get install php5-imagick, but the installed version is 2.0, older. If you need to install version 3.0 or later, you must install it through pecl.

1. sudo apt-get install imagemagick libmagick9-dev2. sudo pecl install imagick3. set "extension = imagick. so "write file/etc/php/conf. d/imagick. ini4. restart web server, sudo/etc/init. d/apache2 restart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.