Results 1 to 6 of 6

Thread: Permission denied during thumbnail creation

  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Default Permission denied during thumbnail creation

    I'm not sure where the problem is. This is what I'm seeing in the conversion report:

    Video id: 12
    Video Output File Name : /var/www/htdocs/vshare/flvideo/4ca4238a0b/8bb63020385c2a72852fcff5a9b13e0e.flv$video_flv = Video Output File Name : /var/www/htdocs/vshare/flvideo/4ca4238a0b/8bb63020385c2a72852fcff5a9b13e0e.flv
    Find video duration - START -/usr/bin/mplayer -vo null -ao null -frames 0 -identify /var/www/htdocs/vshare/video/boyle_semi_700_2.flv
    sh: /usr/bin/mplayer: Permission deniedDuration (mplayer): 0
    DURATION: 00:00

    Create Thumbnail - START

    Create Thumbnail with mplayer - END




    I can run that command:
    /usr/bin/mplayer -vo null -ao null -frames 0 -identify /var/www/htdocs/vshare/video/boyle_semi_700_2.flv


    As the webserver user and as root and as a regular account without any problem. I don't know where the permission problem is occurring. The thumbnails are not created because mplayer is reporting no duration due to the permission problem. Oddly enough, the conversion itself works fine.


    Any ideas?

  2. #2
    Join Date
    Sep 2007
    Posts
    906

    Default

    Login as the user which runs the web server and try access mplayer and see if it works.


    What is the result for

    ls -l /usr/bin/ |grep mplayer
    vShare Hosting, vShare Installation, Server Setup, Lighttpd streaming, vShare Templates
    [email protected]

  3. #3
    Join Date
    Jun 2009
    Posts
    4

    Default

    Here's what I get doing that as the nobody user:

    # sudo -u nobody ls -l /usr/bin | grep mplayer
    -rwxr-xr-x 1 root root 8207616 Dec 4 2008 gmplayer
    -rwxr-xr-x 1 root root 7741080 Dec 4 2008 mplayer


    The mplayer binary should have world execute permissions. I've tried putting 777 permissions on all the directories involved in the process but nothing has worked.

    I'm starting to think that maybe this is a PHP issue. I feel like I've seen this before, where PHP didn't have permission to run a shell script. I have all the required entries in php.ini, but the default php.ini file had a lot of other directives.

  4. #4
    Join Date
    Sep 2007
    Posts
    906

    Default

    try creating a php script with following content and run it


    <?php
    echo exec('whoami');
    ?>
    vShare Hosting, vShare Installation, Server Setup, Lighttpd streaming, vShare Templates
    [email protected]

  5. #5
    Join Date
    Jun 2009
    Posts
    4

    Default

    Yeah, that works fine too. I cannot reproduce the error on the commandline as any user.

    What's weird is the format of the error:

    sh: /usr/bin/mplayer: Permission Denied

    I only see it in the browser (or the debug.txt file) and it only seems to happen with the thumbnail creation. The conversion itself works.

    I swear I've seen this happen before with PHP, but I can't remember. Something is preventing the shell from executing the mplayer binary.

  6. #6
    Join Date
    Jun 2009
    Posts
    4

    Default

    I got around this problem by switching from mplayer to gmplayer. I don't know what the difference is, or why the php class that handles the video duration functions seems to handle it differently.

    From the command line the mplayer binary is executed directly, from the php script via a browser, it seems to be executed as a shell script.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •