Hi,

You can use the "exec" function in PHP to call other programs on the system so you can have a page on the webserver that Flash calls like a URL and have that run a command on the command line.

   http://uk3.php.net/manual/en/book.exec.php

If you are going to do this, I would read up on the security tips and help in the manual too - if you are allowing Flash to specify arguments for the command line program, you are asking for trouble. For example, for transcoding FLV's to MP3's using Flash + PHP with Red5 You are better off making the PHP script decide what to call files and arguments, then telling Flash what the "outputted" file is called.

The other thing you may need to do is override the "timeout" of PHP scripts, if you are running a command that takes some time. You may be better off asking the system to run a command and then "fork" so you can return to the PHP program and send a result back to Flash. You would then need another script that allows you to "poll" for stuff that has finished.

   http://uk3.php.net/manual/en/function.set-time-limit.php

If you are not up on PHP with this, I would seek some help from people / colleagues, as there are quite a few issues with running programs. The other thing is setting it all up in a dev' environment may be fine, but then it does not work on the hosting - maybe because your ISP has locked down the server to prevent command line scripts running. Put <?php phpinfo(); ?> in a php page on the hosting and run it to see what the setup is - executing programs and changing timeouts is often disallowed.

Transcoding and that sort of stuff uses lots of CPU, so shared hosting people will not be happy, but if you have a dedicated server and some nice people hosting it, you may be able to do some good stuff - sorry, I can't recommend anyone as I am a bit rusty with hosting.

   Hope this helps a bit though.

   Glen

BOYD SPEER wrote:
I need to use a command-line app with flash/AS3 that also uses the Red5 open source streaming server. Would anyone know how the set up PHP so Flash can call a php script? Thanks for any suggestions...
-Boyd
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to