简体   繁体   中英

running a linux program viz command line with php?

Been trying to find an answer for this. There is a lot of info on running a php script from the linux command line, however, what I would like to know is how to run a linux command line program from a web page via php.

What i'm after is on the fly processing of files from this program: http://sk1project.org/modules.php?name=Products&product=uniconvertor

Is this possible with php, or would i have to use another language?

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

The system function is what you are looking for.

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

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

i think you can just use the exec()-command in PHP

For example, I'm using FFMPEG to convert uploaded video's to flv.

You can execute a FFMPEG-command through php like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM