In the recent PHP project, you need to use the transduction and thumbnail effects to easily install the PHP imagick extension on the Linux test server. However, in the local Windows development environment, the installation process encountered a lot of problems, here to share with you.
1. Download ImageMagick
Download Address: Http://imagemagick.org/script/binary-releases.php#windows
Download the latest version, Imagemagick-6.8.6-9-q16-x86-dll.exe
2. Installing ImageMagick
Install ImageMagick on the PC. The installation path cannot have spaces, otherwise it cannot be used. At the time of installation, select the Add path to path, or you will have to add the path manually.
3. Test the installation
Open the Windows Command Line window (win+r, cmd, enter), enter convert, carriage return. The Help document for convert appears, if it does not appear, the installation is not successful, or the installation directory is not added to the environment variable path.
Add to environment variables, such as my ImageMagick installation directory is C:/imagemagick.
To add a procedure:
Right-click on the system, environment variable, advanced system settings, and so on, select and edit----Add your installation directory to it.
4. Download PHP extension php_imagick.dll
php5.4.x or php5.5.x download address http://www.peewit.fr/imagick/
dyn = dynamic, st = static, Q16 = 8 bit, q8= bit.
The above logo, the same as you download ImageMagick download logo, I use the Q16
5. Rename the DLL file to Php_imagick.dll and put it in the php extension file directory php/ext.
6. In the php.ini configuration file, add the Extension=php_imagick.dll.
7. Restart the computer, restart the PC only if it is not used. Because the extension is using Imagemagic software, the software restarts the computer, reloads the software, and refreshes the path path.
8. After restarting, open the Phpinfo page to view, the extension has been installed successfully. If the installation is not successful, it is highly likely that the ImageMagick software version is too high, please select a lower-level version installation.
9. PHP test Code.
<?php$im = new Imagick (' a.jpg ');//resize by width and keep the ratio$im->thumbnailimage (0);//write to Disk$im->writeimage (' a_thumbnail.jpg ');
10. View manuals, Learning API
The relevant extended Learning manual address http://uk3.php.net/manual/zh/book.imagick.php manual contains a number of easy-to-use examples.
Here is also a document that looks at the command line arguments http://www.imagemagick.org/Usage/
http://www.bkjia.com/PHPjc/824630.html www.bkjia.com true http://www.bkjia.com/PHPjc/824630.html techarticle In the recent PHP project, you need to use the transduction and thumbnail effects to easily install the PHP imagick extension on the Linux test server. But in the local Windows development environment, the installation process ...