Jump to content

ffmpeg + exec - permissions problem?


JavaNinja

Recommended Posts

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"  ;D whats going on! Do you think the above is a good enough test that exec() is working as it should be?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.