我已经在本地Windows 7 PC上成功安装了ImageMagick。并测试转换C:\ xampp \ htdocs \测试\图像\ a.jpg C:\ xampp \ htdocs \测试\图像\ b.jpgImageMagick与PHP执行路径转换
但是,当我试图从一个名为C: \ XAMPP \ htdocs中\测试\的index.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
$输出是空白的,$回报是1
然而,当我使用
<?php
exec("C:\Program Files\ImageMagick-6.8.9-Q16\convert", $output, $return);
?>
我得到的输出作为Imagemagick版本... 如果我在命令提示符下运行命令“convert”,则输出相同。 我在Windows 7中使用xamp。 我已经搜索了很多,但那里提到的问题不是我面对的。
因为当我在PHP EXEC中只使用“convert”时,我得到了输出。
所以不明白什么是实际问题。
是的。我在目录下使用了php fwrite C:\ xampp \ htdocs \ test \ images test.txt 并且它成功创建并且is_writeable(__ DIR __。'/ images');当我执行index.php时返回true。 –