php ImageMagick windows下安装教程,phpimagemagick
php ImageMagick windows下安装教程,phpimagemagick
1、下载ImageMagick
打开http://imagemagick.org/script/binary-releases.php#windows 下载最新的版本,目前的版本是 ImageMagick-6.5.4-2-Q16-windows-dll.exe
现在的静态版本能够很好的在各个平台上运行,但是他们却很难懂,因此您应该下载一个动态的版本。如果你的系统/电脑支持16位色,那么你应该使用Q16版本(还有一个是8位的版本),这两者的区别我们将会在下面解释。
对我自己来说,最近的一个版本在我的电脑上不能够很好的运行,所以我使用一些老版本,ImageMagick-6.4.2-7-Q16-windows-dll这个版本适合我。我的电脑是Windows XP SP2, 32 Bit, Intel Centrino 1.76GHZ,本你能够从这里下载这些老版本here。
我在这里建议你使用最新的版本,按照下面的步骤操作,如果不能正常使用,那么再换回老版本。
2、安装Install ImageMagick
安装IM在下面的目录
复制代码 代码如下:
C:\imagemagick\
中间没有空格。不要安装到 c:\program files\etc
千万不要忘记点击"Add to system path" 按钮,其他的选择按钮你不用管。
3、测试安装是否成功
打开命令行 (运行->"CMD"->回车),输入 convert 后按回车。你应该能够看见帮助内容,如果是这样的那么你直接到第四步去。
如果提示"convert不是内部或外部命令,也不是可运行的程序或批处理文件”或者提示“请输入转换的盘符”(convert是一个默认的将FAT32转换到NTFS的系统命令)那么你需要自己将ImageMagick的安装路径添加到系统路径。
我的电脑 -> 单击右键 -> 属性 -> 高级 -> 环境变量 -> 系统变量 -> 找到 "Path" -> 选中并点击进行编辑 -> 把你的安装路径添加进去。
4、下载 php_Imagick.dll
由于版本的问题, 如果你使用 PHP 5.2.x 在请这里 where you will get your 下载dll。dyn = dynamic(动态), st = static(静态), q16 = 16 bit(16位), q8= 8 bit(8位)。当然这应该和你下载的版本想匹配,如果你下载的是q16动态库,你的对应的文件就是php_imagick_dyn-Q16.dll
如果你在使用 PHP 5.3.x, 这个去下载你所需要的版本this is your location 。
5、安放 dll 到你的扩展文件夹
为了方便使用,重命名你下载的DLL文件为 php_imagick.dll 并安放到你的扩展文件夹,通常情况下是:
复制代码 代码如下:
php/ext/
如果不是的,那么你可以在你的php.ini文件中找到相应的扩展目录。
复制代码 代码如下:
Directory in which the loadable extensions (modules) reside.extension_dir = "Something something"
6、编辑 PHP.ini
如果存在下面这句话就直接去掉注释要是不存在则自己添加下面这句话
复制代码 代码如下:
extension=php_imagick.dll
7、重启
非常重要的一步,我花了大约一个小时的时间去搞定它,但是。。。你需要重启你的电脑以生效。
如果你不重启你的电脑而只是重启你的apache那么你将会看见不能加载这个模块的错误,因此请千万要重启电脑。
复制代码 代码如下:
Unable to find CORE_RL_Wand.dll something something.
8、启动apache并检查相应的设置
启动apache,检查phpinfo() ,如果你看见 imagick 库和是所设定的相应的值那么直接去第九步。
如果你安装后不能正常使用,那么你可以先换几个DLL试试,要还是不行,可以换个老版本的ImageMagick试试,总之别灰心。
9、测试看看
放一张图片到和test.php脚本相同的目录并命名为a.jpg,运行脚本,如果能够看到a_thumnail.jpg这张图片那么就ok了。下面是脚本
复制代码 代码如下:
$im = new imagick( 'a.jpg' );
// resize by 200 width and keep the ratio
$im->thumbnailImage( 200, 0);
// write to disk
$im->writeImage( 'a_thumbnail.jpg' );
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.
