PHP Exec函数报告某些通过SSH工作的命令失败
我在使用PHP 5.4.12的CentOS 6 64位上。 这是PHP非常奇怪的行为。 请参阅以下脚本: echo 'Trying Query: whereis jbig2dec<br>'; exec('whereis jbig2dec',$output) or die('Failed'); $location=explode(' ',implode($output)); $location=$location[1]; echo 'Result: '.implode($output)."<p>"; echo 'Trying Query: '.$location.' --help<br>'; exec($location.' --help',$output) or die('Failed'); echo 'Result: '.implode($output)."<p>"; echo 'Trying Query: jbig2dec --help<br>'; exec('jbig2dec --help',$output) or die('Failed'); echo 'Result: '.implode($output)."<p>"; 结果是: Trying Query: whereis jbig2dec …