Running ImageMagick on XAMPP 1.8.3 with Windows 7

后端 未结 3 1871
别那么骄傲
别那么骄傲 2020-12-01 10:55

I have been trying for hours to get ImageMagick working on my localhost (running XAMPP 1.8.3 on Windows 7). I have checked and tried literally every solution that I can find

相关标签:
3条回答
  • 2020-12-01 11:19

    OK. I finally found a combination that works. After MUCH trial and error, I was finally able to get the below combination to work on my machine. Hopefully it works for anyone else who might be struggling with this.

    • OS: Windows 7 64 Bit
    • PHP: 5.5.6
    • XAMPP: 1.8.3
      • Compiler: MSVC11
      • Architecture: x86
    • ImageMagick: ImageMagick-6.7.7-5-Q16-windows-dll (available here)
    • Imagick DLL: PHP5.5.x version from http://www.peewit.fr/imagick/

    Note: Once I tried this, Apache started without any error messages. I did not have to restart my computer (just restarted Apache). I do have ImageMagick installed in a directory that has no spaces in the name (as some have suggested that might be a problem with some installs). In my case, I installed it to c:\xampp\imagemagick.

    Best of luck to you!

    0 讨论(0)
  • 2020-12-01 11:36

    Imagick is a PECL extension and the official windows.php.net site has compiled versions of PECL extensions.

    Please download Imagick from: http://windows.php.net/downloads/pecl/releases/imagick/

    And download ImageMagick from: http://windows.php.net/downloads/pecl/deps/

    Please note, downloading Imagick from one site, and downloading ImageMagick from another site is likely to not work! This is because when Imagick is compiled it uses several settings that vary based on what versions of ImageMagick it is being compiled against.

    FYI the maintainer of the Imagick extension recommends not running it inside Apache, but instead to run it as a background task through something like SupervisorD or cron. This is both for security and performance reasons.

    0 讨论(0)
  • 2020-12-01 11:44

    After spending many hours trying to get this blasted thing to work (Windows 7, 64-bit), with no success, I decided to look at other systems to see how they handled the problem. What mediawiki did was simply NOT USE the ImageMagick/PHP extension! They call the ImageMagick convert.exe program directly and use the result (see includes/media/Bitmap.php in the mediawiki package).

    You can't really blame people for abandoning the PHP extension, since apparently it has to be compiled with the "right" ever-varying compiler and matched at least with apache and ImageMagick builds. What is surprising about the situation is that this problem has been going on for over five years and it still isn't handled.

    So my "solution/answer" isn't really one, it basically is to call ImageMagick a different way to avoid the problem, like mediawiki did.

    0 讨论(0)
提交回复
热议问题