【发布时间】:2012-01-10 18:23:35
【问题描述】:
我必须使用 php 中的 imagemagick convert 命令。所以我使用shell_exec,但它的输出是空字符串。我知道命令 convert 不会在 STDOUT 上打印任何内容,但也没有达到所需的 convert 输出。 exec 也不起作用。这些命令从 shell 或 php 命令行运行良好。可能是什么问题?
编辑:添加 2>&1,我了解到 convert 会引发错误:missing an image filename/a5d98168a524a331c5e06d60096debd63cbdce1f.jpg'@error/convert.c/ConvertImageCommand /2970.where the full command isconvert /var/www/weblog/web/uploads/poster/a5d98168a524a331c5e06d60096debd63cbdce1f.png /var/www/weblog/web/uploads/poster/a5d98168a524a331c5e06d60096debd63c.jpg
【问题讨论】:
-
查看
error.log或在命令后添加2>&1。 -
@mario:我已经更新了问题
-
检查应用对目录有写权限。
标签: php imagemagick shell-exec