shell_exec(): Cannot execute in Safe Mode

PHP Safe Mode is causing some issues with executing some scripts that the Flash Video Module is using.
We have the file permission setup and we can upload the videos_import dir, It's definately finding the video,
because it moves it out into main files directory, then seems to fail out trying to call a script to create the flash.

* warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/.../modules/flashvideo/flashvideo.module on line 880.

Safe mode is good thing because it keeps the site locked down, so we gotta figure out how to allow it to run
the ffmpeg conversion script (via the cron) it's not creating the .flv file yet.

Any Ideas... Help~!

Have you tried using just

Have you tried using just exec() instead of shell_exec()?

Same problem, but exec() doesn't create FLV/JPG

I ran into this problem too, and changed line 1161 to exec instead. However, neither the FLV, nor the JPG thumbnail get created. In fact, the database tables contain the same information as when I get the shell_exec error:

1. files table: original file in the files folder, renamed with nid prefix.
2. ffmpeg_data table: two rows, one for the JPG command and one for the FLV. Both commands work perfectly when done at the command line.
3. flashvideo table: one row where the fid = oid i.e. the original file listing, with status = 0.

I'm pretty sure everything else is setup correctly:

I have recompiled ffmpeg twice (using instructions on ubuntu first, then here) to no avail. I have triple-checked the Flashvideo settings, made sure paths (ffmpeg @ usr/local/bin/ffmpeg) are correct and writable (777), and altered htaccess to change the PHP settings. Running cron.php does nothing for me. I even changed owner and group to the same as the one that creates the renamed original file (www-data in my case) for each of the output folders, just in case.

And like I said, running the commands from ffmpeg_data at the command line creates the correct working files. Naturally, the table entries are not created, but if I do those manually, everything works perfectly.

This has been bugging me for a couple of days now. Any suggestions would be appreciated.

System info: PHP5, MySQL5, Apache2, Flashvideo 2.5 (Nov 18, 2007), Drupal 5.5 multisite (modules in sites/all, actual site in sites/mysite).

*edit* I added in some print statements to see what's happening where. It always gets to line 1161 and executes $command. However, there is no ouput put into $ffmpeg_data. It will then skip the next "if(file_exists($output_path)" bit and go to the "else" part. This will repeat for the JPG and the FLV. Below is the output from each of the variables:

$ffmpeg_data =
$command = /usr/local/bin/ffmpeg -y -i "/var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/40_santa6.mpg" -vframes 1 -ss "00:00:02" -an -vcodec mjpeg -f rawvideo -s "130x100" "/var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/movies/40_santa6.jpg"
$output_path = /var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/movies/40_santa6.jpg

$ffmpeg_data =
$command = /usr/local/bin/ffmpeg -i "/var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/40_santa6.mpg" -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 "/var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/movies/40_santa6.flv"
$output_path = /var/www/vhosts/mainsite.com/httpdocs/mysitefolder/files/movies/40_santa6.flv

Thats very interesting. I

Thats very interesting. I know that there is a setting that you can set up to now allow the exec and shell_exec commands to work in PHP. I do not know where to look to check for this, but you might do some research and see if you have these commands disabled for the user that you are using. If this is the case, then you will have to enable them to work, otherwise the FlashVideo module will never work.

Please keep me informed as to your progress as I am thinking of adding this to the Troubleshooting guide to FlashVideo.

Thanks,

Travis.