Re: php execute command on server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 28, 2007 6:02 pm, Jody Gugelhupf wrote:
> vlc command itself executed on my machine from the console shows that
> the command works fine, this
> probably means that somehting is wrong with my php file.

Not necessarily all that useful...

PHP runs as a different user in a different environment than you do in
your logged in shell.

su to the PHP User and try running the vlc thingie.

> the second command opens the vlc stream from the server, which works
> fine too
> anyhow back to the first command the vlc stream server executer, i can
> see it in the list of the
> running processes on my machine, but the stream does not work, i don't
> know why, either there is
> somehting wrong with my php:
>
> <?php
> // outputs the username that owns the running php/httpd process
> // (on a system with the "whoami" executable in the path)
> echo system('vlc
> v4l:/dev/video0:norm=pal:frequency=767250:size=320x240:channel=0:adev=/dev/dsp:audio=0
> --sout
> \'#transcode{vcodec=mp4v,acodec=mpga,vb=3000,ab=256,vt=800000,keyint=80,deinterlace=blend}:std{access=http,mux=ts,url=10.0.0.1:8082}\'
> --ttl 12 -I dummy');
> ?>
>
> or does the www-data (apache) user needs special user permissions to
> access the devices
> /dev/video0  /dev/dsp ? i have no clue, is there a way to see some
> output? thx for the help :)


Use http://php.net/exec and check the error codes returned.

Almost for sure, yes, the PHP user needs to be added to whatever group
has access to those devices.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux