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