JavaNinja Posted October 21, 2008 Share Posted October 21, 2008 Hello all, First post I have asked this question on other forums and I still haven't solved this problem so I will try here. I would like to create a jpeg thumbnail using ffmpeg from an flv video. I can do this already (by running the command manually on the shell). I want to execute this command with PHP using the exec() function but it isn't working. I think it is a permissions problem but what?! $command = "ffmpeg -i $mediaPath -y -f mjpeg -ss 8.00 -an $thumbnail"; exec($command, $output, $return_var); return $return_var; Currently $return_var returns a error code of 126 which is "a script that is not executable" - but I have chmod it 775! I really need help or some sort of direction. Been desperatley trying to solve this problem for a while now! Quote Link to comment Share on other sites More sharing options...
DarkWater Posted October 21, 2008 Share Posted October 21, 2008 Chmod it to 777 and don't return $return_var, echo it (unless you're in a function, but it doesn't appear that way). Quote Link to comment Share on other sites More sharing options...
JavaNinja Posted October 22, 2008 Author Share Posted October 22, 2008 It is in a function and I do echo it out within this function to test it too. I have chmod it to 777 and this has made no difference!! I could really rip somebody elses hair out! Quote Link to comment Share on other sites More sharing options...
JavaNinja Posted October 25, 2008 Author Share Posted October 25, 2008 Ok, I found out that PHP runs as apache user. So I have apache the ffmpeg the owner of ffmpeg even and no difference! I have even installed ffmpeg in the web root but it still doesn't work. Do you guys think its a permissions problem? I can run and use ffmpeg as root easily without no errors! HELP! Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted October 25, 2008 Share Posted October 25, 2008 it is a permissions thing - can you run ANY exec command on the server? if you can't then contact your server dude and ask them allow php to do so. To check just use exec to call anothe php file that sends you an email or something - that'll let you know if exec is avaialbel to you. If it is then you'll have to ask server dudes why you can't run ffmpeg. Quote Link to comment Share on other sites More sharing options...
JavaNinja Posted October 25, 2008 Author Share Posted October 25, 2008 Thanks for you reply, I am really struggling with this. I can use exec to execute certain things, for example: <?php exec('ls -l', $output, $plus); echo $plus.'<br>'; print_r($output); ?> This worked fine, so now I am going to ask the "server dudes" whats going on! Do you think the above is a good enough test that exec() is working as it should be? Quote Link to comment Share on other sites More sharing options...
JavaNinja Posted October 25, 2008 Author Share Posted October 25, 2008 I am speaking to my server people now and they are saying I may need to change the PHP configuration?! My php version is 5.2.6 and I was thinking about doing something with the "safe_mode_exec_dir" but safe mode will be removed from now on in php version 6. How else can I configure PHP to work with ffmpeg? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.