shell_exec没有为inkscape命令执行sh文件


shell_exec not executing sh file for inkscape command

one.sh

#! bin/bash
command="cp 357.svg 000.svg"
echo "Executing Command";
exec $command;

通过执行sh one.sh从shell运行perfact,甚至在php中shell_exec("sh one.sh");也能正常工作。

两小时

#! bin/bash
command="/usr/bin/inkscape -f 357.svg -e 357.png"
echo "Executing Command";
exec $command;

从外壳sh two.sh工作良好

但使用phpshell_exec("sh two.sh")不执行

谁能告诉我为什么它没有执行吗?

try:

echo shell_exec("sh two.sh 2>&1;")

看看输出是什么,也许它会给你一个拒绝权限的错误。也许还值得检查一下你使用的是哪个用户(可能是www数据)