ok, i am running the script like this now:
------------ START -------------

$var=shell_exec("/home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh 
/tmp/pitstop.mpeg");
echo "--$var--";
------------ STOP -------------
Where echo returns nothing. I did a chmod 777 on the getfilelength.sh file.


When i run the file in shell i get this:
$ /home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh
/tmp/pitstop.mpeg
16


The Shell file looks like that:
if [ "$1" ];then
        length="`mplayer -identify -frames 0 $1 2>/dev/null| grep ID_LENGTH
| cut -d \"=\" -f 2`"
        echo $length
....




> On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote:
> 
> > > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> > > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
> >
> > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
> > echo "Output: $var";
> >
> > Still gives nothing back :/
> > Told you, its not that easy :P
> 
> Have you:
> 
> 1) Turned on full error reporting?
How do i turn that on?

> 2) Checked that (i) you're not running in safe_mode, or (ii) if you are,
> that 
> you are allowed to access those executables?
i am running in safe mode.

> 3) Confirmed that the left side of the pipe is working and giving the
> expected 
> output?
$var2=shell_exec("mplayer -identify -frames 0 /tmp/pitstop.mpeg | /bin/grep
ID_LENGTH");
gives nothing back.

Thats what i get in Shell:
---------------------------------
$ mplayer -identify -frames 0 /tmp/pitstop.mpeg | grep ID_LENGTH
: No such file or directory
Can't open '/home/lansinplayer/.mplayer/codecs.conf': No such file or
directory
Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or
/dev/rtc should be readable by the user.)
Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such
file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file
or directory
Falling back on default (hardcoded) input config
vo: couldn't open the X11 display ()!
vo: couldn't open the X11 display ()!
VO XOverlay need a subdriver
vo: couldn't open the X11 display ()!
Can't open /dev/fb0: Permission denied
[fbdev2] Can't open /dev/fb0: Permission denied
audio_setup: Can't open audio device /dev/dsp: Permission denied
ID_LENGTH=16



> 4) Tried giving the full path to grep?
yes i did
> 
> If you're still having trouble with it you can try sticking the above into
> a 
> little shell script and shell_exec() the shell script instead.
See above.


Any further ideas?

Thank you, Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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

Reply via email to