摘要:
转自:http://blog.csdn.net/ricky1217/article/details/6934202参考:http://www.byreach.com/m/node/1439同样的代码,发现通过 localhost/index.php 访问,和在 shell 中通过 php ./index.php 运行結果却不一样。在程序中需要通过 shell_exec 来执行一个 linux 程序,而它的输入来自 echo ,即:shell_exec('echo '.escapeshellarg($str).' | some_cmd 2>&1'); 阅读全文