Welcome Guest, Not a member yet? Register   Sign In
Running scripts with exec
#1

[eluser]pdxbenjamin[/eluser]
I have a script, it's a fork off ffmpeg called ffmpeg2theora. It is a .bin file. I've been told that these .bin files are like .exe's on Windows. From my php scripts in the controllers I have to execute them with the exec function.

exec("./ffmpeg2theora-0.27.linux64.bin [options] filename");

But what I'm thinking is that I have a path issue. Because my .bin will not execute from script.

However, I can execute it fine from the command line. It actually works really well, and makes ogv files like a champ.

From my script if I do something like this... and add the absolute path it still doesn't work.

exec("./srv/scripts/ffmpeg2theora-0.27.linux64.bin [options] filename");

I have the file in a folder outside my www directory where my Ci stuff is.
for example...
/
srv/
/scripts
/www
/public_html
/system
so on and so on...


If anyone can help with my path issues, or get exec to kick me some errors so I can see what's going on that would be very much appreciated. Thanks!
#2

[eluser]mddd[/eluser]
If you start the path with ./ , you are not using an absolute path but a relative one.
If you can start it from the command line, that is probably because you are in the right directory.
Try specifying the complet path, starting with / (the root of the volume).




Theme © iAndrew 2016 - Forum software by © MyBB