我必须使用imagemagick
convert
命令从PHP。所以我使用shell_exec
,但输出是空字符串。我知道命令convert不会在STDOUT上打印任何内容,但是convert
的期望输出也没有实现。 exec
也不起作用。这些命令可以在shell或php命令行下正常运行。可能是什么问题?php shell_Exec不工作而命令在shell中工作
EDIT:添加2> & 1,I得知转换抛出一个错误:missing an image filename
/a5d98168a524a331c5e06d60096debd63cbdce1f.jpg” @错误/ convert.c/ConvertImageCommand/2970。 where the full command is
convert /var/www/weblog/web/uploads/poster/a5d98168a524a331c5e06d60096debd63cbdce1f.png/var/www/weblog/web/uploads/poster/a5d98168a524a331c5e06d60096debd63cbdce1f.jpg`。
在命令后面查看'error.log'或添加'2>&1'。 – mario 2012-01-10 18:29:17
@mario:我已更新问题 – prongs 2012-01-10 18:31:29
检查应用程序对目录具有写入权限。 – 2012-01-10 18:35:34