hi there,
i'm trying to do exec('ivtv-tune -f 100') in php but it seems like it won't except the '-f 100' part. I've tried escaping it or using quotes around it but i can't get it to work.
Does anybody have a solution to this? Thanks for reading.
hi there,
i'm trying to do exec('ivtv-tune -f 100') in php but it seems like it won't except the '-f 100' part. I've tried escaping it or using quotes around it but i can't get it to work.
Does anybody have a solution to this? Thanks for reading.
What I read from here is:
What I see in your commandline there is a space between -f and 100:-fFLOAT --frequency=FLOAT set new frequency (MHz)
Probably you'll need to remove that.-f 100
I don't know the package, so I only tell what I just read.
thank you for answering. There is a space there, yes. However, wether i use exec('ivtv-tune -f 100') or exec('ivtv-tune --frequency=100') i get the same result (as if i gave no parameters), but both ways work when i use regular command line interface.
I guess it's not going to change anything, but I never use single quotes with exec.
That's mostly because with MySQL-queries '".$somevar."' is more simple to me than \"".$somevar."\" but as a result of that I always use double quotes (1x ") to define PHP commands.
Another way to try could be:
$somevar="ivtv-tune --frequency=100";
exec($somevar);
Thanks for your reply, I tried it but it didn't work. I've found a way to make it work though. The answer was to just simply use sudo (or just change the user/rights that php/apache uses of course):
Code:system("sudo ivtv-tune -f 100");
Last edited by fairieswearboots; June 6th, 2010 at 12:37 PM.
Bookmarks