【发布时间】:2014-07-25 09:01:01
【问题描述】:
我已在本地 Windows 7 PC 上成功安装 ImageMagick。并测试转换 C:\xampp\htdocs\test\images\a.jpg C:\xampp\htdocs\test\images\b.jpg
但是当我尝试从名为 C:\xampp\htdocs\test\index.php 的 PHP 文件中执行此操作时 用代码
<?php
exec("C:\Program Files\ImageMagick-6.8.9-Q16\convert C:\xampp\htdocs\test\images\a.jpg C:\xampp\htdocs\test\images\b.jpg", $output, $return);
?>
它不起作用。 a.jpg 文件存在。我正在使用浏览器运行 index.php 文件,路径为http://localhost/test/index.php
$output 为空,$return 为 1。
但是当我使用
<?php
exec("C:\Program Files\ImageMagick-6.8.9-Q16\convert", $output, $return);
?>
我得到了 Imagemagick 版本的输出...... 如果我在命令提示符下运行命令“convert”,则输出相同。 我在 Windows 7 中使用 xamp。 我搜索了很多,但那里提到的问题不是我遇到的。
因为当我在 PHP exec 中只使用“convert”时,我得到了输出。
所以无法理解实际问题是什么。
【问题讨论】:
标签: imagemagick