1、在 Windows 10 64 位、PHP 7.4.6 中,报错:PHP Warning: PHP Startup: Unable to load dynamic library ‘imagick’ (tried: C:/php-7.4.6/ext/imagick,如图1
PS C:/WINDOWS/system32> php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.6/php.ini PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: C:/php-7.4.6/ext/imagick (鎵句笉鍒版寚瀹氱殑 妯″潡銆?<br /> <b>Warning</b>: PHP Startup: Unable to load dynamic library 'imagick' (tried: C:/php-7.4.6/ext/imagick (鎵句笉鍒版寚瀹 氱殑妯″潡銆?, C:/php-7.4.6/ext/php_imagick.dll (鎵句笉鍒版寚瀹氱殑妯″潡銆?) in <b>Unknown</b> on line <b>0</b><br />
2、参考:https://www.shuijingwanwq.com/2017/08/30/1768/ ,之前在 PHP 7.0 中出现了类似的问题
3、打开:http://windows.php.net/downloads/pecl/deps/ ,下载:ImageMagick-7.0.7-11-vc15-x64.zip,如图2
4、新建目录:C:/ImageMagick-7.0.7,复制目录:D:/Soft/ImageMagick-7.0.7-11-vc15-x64/bin 下的所有文件至目录:C:/ImageMagick-7.0.7,如图3
5、更新环境变量:C:/ImageMagick-6.9.3-7-vc14-x64 为 C:/ImageMagick-7.0.7,如图4
6、更新系统变量:MAGICK_HOME,其值为:C:/ImageMagick-6.9.3-7-vc14-x64,更新为:C:/ImageMagick-7.0.7,如图5
7、重启机器,运行:php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.6/php.ini,正常
8、运行:convert –version,正常,版本更新为:ImageMagick 7.0.7-11 Q16 x64,如图6
PS C:/WINDOWS/system32> convert -version Version: ImageMagick 7.0.7-11 Q16 x64 2017-11-23 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Visual C++: 191125547 Features: Cipher DPC HDRI Modules OpenMP Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml z lib
9、查看phpinfo(),正常,如图7
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/250531.html