如何从PHP的shell_exec执行ImageMagick命令?

时间:2017-11-25 13:56:13

标签: php macos imagemagick imagemagick-convert imagemagick-identify

$path = getenv("PATH");
putenv("MAGICK_HOME=/Users/oa/Documents/software/ImageMagick-7.0.7");
putenv("DYLD_LIBRARY_PATH=/Users/oa/Documents/software/ImageMagick-7.0.7/lib");
putenv("PATH=/Users/oa/Documents/software/ImageMagick-7.0.7/bin:".$path);

$output = shell_exec("convert -page +0+0 src.jpeg foo.gif");

我明白了:

  

dyld:未加载库:   /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib参考自:/Users/oa/Documents/software/ImageMagick-7.0.7/bin/convert
  原因:未找到图像

0 个答案:

没有答案