raplhie
raplhie

Reputation: 41

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?

Upvotes: 0

Views: 385

Answers (4)

v3rt1g0
v3rt1g0

Reputation: 43

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");

Upvotes: 1

Kristian Glass
Kristian Glass

Reputation: 38510

Both passthru and exec should be able to do that for you.

Upvotes: 1

Šimon Tóth
Šimon Tóth

Reputation: 36433

The system function is what you are looking for.

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

Upvotes: 1

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272497

You have various options, such as system() and shell_exec().

Upvotes: 1

Related Questions