目前我的目标是使用查看 PHP exec() 的输出,但得到一个空值。我正在使用 firephp (firebug 扩展)日志记录,但无法弄清楚为什么它是空的。
完整代码在这里:https://github.com/MattMcFarland/ninja-forms-uploads-custom/blob/dev/uploads-custom.php https://github.com/MattMcFarland/ninja-forms-uploads-custom/blob/dev/uploads-custom.php
表格在这里:
exec('mogrify -auto-orient -verbose -format jpg '.$dir."/".$user_file_name,$ouput);
fb($output);
curl_exec('mogrify -auto-orient -verbose -format jpg '.$dir."/".$user_file_name,$output);
fb($output);
$output = shell_exec('mogrify -auto-orient -verbose -format jpg '.$dir."/".$user_file_name);
fb($output);
目前,对于我正在使用的每个 exec 方法,控制台显示为空。真的不知道该怎么办,完全不知所措。
控制台也正常工作,它显示了其他内容fb();
东西。 exec 命令显示一个空行,前面有数字 3,表示空返回 3 次。
有任何想法吗?
问题是权限问题。不允许用户使用 BASH。
必须将 apache 用户的 /etc/passwd 中的 bin/false 更改为 bin/bash 。
事后看来,添加 bin/mogrify 可能会更好
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)