[NOT SOLVED] exec not operating at all...?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

[NOT SOLVED] exec not operating at all...?

Post by phice »

Basically I'm trying to run ffmpeg inside exec() to take a screenshot of a video, read the saved file and out it to the browser.

I've got the command made up that works just find in ssh with root access, but when I try it within exec nothing happens. Nothing displays, no file is saved like it normally is through the command line, etc.

Why do you think this is? Do I need to enable something? Or CHMOD a directory or something?

Many thanks in advance.
Last edited by phice on Fri Mar 31, 2006 1:13 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yeah, it may be a permissions thing. That's roughly what it was (that I remember) when I had a similar problem -- different program, but same sort of thing.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Permissions with what? PHP itself? ffmpeg? The directory that it's accessing and/or writing to?

Don
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

all of the above. :D
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

What would I set each one to? :?
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

I ran into this problem myself. However I was calling a bash script that contained pipes in it's own call to another script :oops:


caused php to bomb. could be the same thing for you, could not. just a thought though.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Any help with what I should CHMOD guys? And to what? Probably 0777 eh?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I think it all really depends on who owns each or what groups each is. If they are all different, and you can't chown or chgrp them, 0777 is the most open (although fairly dangerous)
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

What should I CHMOD is really all I need to know (I think).

Should it be the folder that it's writing the screenshot to? The folder ffmpeg is grabbing the videos to? The PHP application itself (if I can find it)? FFMPEG (and it's entire folder?)?

Thanks, Don
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

php needs execution rights for ffmpeg; ffmpeg may need rights to write to the destination and read rights for the source (although it may run under php's rights, in which case php would need those); and php will need reading rights for the destination folder (at least.)

It's been a while since I had to fiddle with permissions like this so I could be completely off in space.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Just so I don't goof anything up, how would I go about chmoding these applications? Just do something like "chmod 0777 /usr/local/ffmpeg/ffmpeg" ?
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

should probably use 775 instead of 777 imo. maybe even 666..
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Anything that works would be fine with me.
Post Reply