PHP ImageMagick Windows installation Tutorials _php Tips

Source: Internet
Author: User
Tags imagemagick php download php script versions

1, download ImageMagick

Open http://imagemagick.org/script/binary-releases.php Download the latest version, the current version is Imagemagick-6.5.4-2-q16-windows-dll.exe

Today's static versions can work well on various platforms, but they are hard to understand, so you should download a dynamic version. If your system/computer supports 16-bit colors, you should use the Q16 version (and a 8-bit version), and the difference will be explained below.

For myself, a recent version of my computer doesn't work very well, so I use some old versions, imagemagick-6.4.2-7-q16-windows-dll this version for me. My computer is Windows XP SP2, Bit, Intel Centrino 1.76GHZ, you can download these old versions here.

I recommend that you use the latest version, follow the steps below, and if not, change back to the old version.

2, installation install ImageMagick

Install IM in the following directory

Copy Code code as follows:

C:\imagemagick\

There are no spaces in the middle. Do not install to C:\Program Files\etc

Do not forget to click the "Add to System Path" button, and you do not need to control the other selection buttons.

3, test installation is successful

Open the command line (run-> "CMD"-> carriage return), enter convert and press ENTER. You should be able to see the Help content, if so then you go straight to step fourth.

If you are prompted that convert is not an internal or external command, is not a running program or batch file, or prompts you to enter a converted drive letter (Convert is a default system command that converts FAT32 to NTFS) then you need to add the ImageMagick installation path to the system path yourself.

My Computer-> right-click-> Properties-> Advanced-> environment variable-> system variable-> find "path"-> Select and click Edit-> Add your installation path.

4, download Php_imagick.dll

Due to the version of the problem, if you use PHP 5.2.x in please here where you'll get your download DLL. dyn = dynamic, st = static (static), Q16 = bit (16-bit), q8= 8 bit (8-bit). Of course this should and you download the version want to match, if you download is q16 dynamic Library, your corresponding file is Php_imagick_dyn-q16.dll

If you are using PHP 5.3.x, this goes to download the version you need this is your location.

5, put the DLL to your extended folder

For ease of use, rename your downloaded DLL file as Php_imagick.dll and place it in your Extended folder, usually:

Copy Code code as follows:

php/ext/

If not, then you can find the appropriate extended directory in your php.ini file.

Copy Code code as follows:

Directory in which the loadable Extensions (modules) Reside.extension_dir = "Something Something"

6. Edit PHP.ini

If the following sentence is present, remove the annotation directly if it does not exist, add the following words yourself

Copy Code code as follows:

Extension=php_imagick.dll

7, restart

A very important step, it took me about one hours to get it done, but ... You need to reboot your computer to take effect.

If you don't reboot your computer and just reboot your Apache then you will see the error of not loading the module, so be sure to reboot the computer.

Copy Code code as follows:

Unable to find core_rl_wand.dll something something.

8, start Apache and check the appropriate settings

Start Apache, check Phpinfo (), and if you see the Imagick Library and the corresponding value set, go to step nineth directly.

If you do not use the normal after installation, then you can change a few DLLs to try, or not, you can change the old version of the ImageMagick try, in short, don't lose heart.

9, test to see

Put a picture into the same directory as the test.php script and name it a.jpg, run the script, and if you can see a_thumnail.jpg this picture then OK. Here is the script

Copy Code code as follows:

?
$im = new Imagick (' a.jpg ');
Resize by width and keep the ratio
$im->thumbnailimage (200, 0);
Write to disk
$im->writeimage (' a_thumbnail.jpg ');
?>

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.