用php运行linux程序viz命令行?

时间:2011-09-05 14:23:30

标签: php linux

一直想找到答案。关于从linux命令行运行php脚本有很多信息,但是,我想知道的是如何通过php从网页运行linux命令行程序。

我所追求的是对此程序中文件的即时处理: http://sk1project.org/modules.php?name=Products&product=uniconvertor

这可能用php,还是我必须使用其他语言?

4 个答案:

答案 0 :(得分:1)

您有多种选择,例如system()shell_exec()

答案 1 :(得分:1)

您正在寻找system功能。

http://php.net/manual/en/function.system.php

答案 2 :(得分:1)

passthruexec都应该能为您做到这一点。

答案 3 :(得分:1)

我认为你可以在PHP中使用exec() - 命令

例如,我正在使用FFMPEG将上传的视频转换为flv。

您可以通过php执行FFMPEG命令,如下所示:

exec("ffmpeg -i $input -s 320x240 -ar 44100 -r 12 $output");
相关问题