Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Location
    UK
    Posts
    285

    ffmpeg within PHP.. "Permission Denied"

    Hi,

    I'm trying to do some video processing with ffmpeg in a VPS.. i've basically set it up with a LAMP stack and then installed ffmpeg under user root.

    When i try to execute a command via PHP i get a permission denied error

    PHP Code:
    sh: /root/bin/ffmpegPermission denied 
    I've had a quick Google and my findings point me towards apache being run under a different user to what ffmpeg was installed under and does not have permission. Unfortunately i'm not a linux expert and struggling to find how to correct it. Any ideas?

    thanks.

  2. #2
    Join Date
    May 2012
    Location
    India
    Posts
    1,026

  3. #3
    99% apache running from another user , change permission to execute by everyone . 755

    chmod 755 /root/bin/ffmpeg

    may be will get problems with another files . do same .
    << Please review signature guidelines >>

  4. #4
    Join Date
    Jan 2013
    Posts
    72
    Quote Originally Posted by alyak View Post
    99% apache running from another user , change permission to execute by everyone . 755

    chmod 755 /root/bin/ffmpeg

    may be will get problems with another files . do same .
    1. Changing the permissions on a binary in the root folder will not allow a non-root user to execute that command.
    2. Shared binaries, and other programs should not be installed into the /root folder in the first place.

    Quote Originally Posted by forcerr View Post
    Hi,

    When i try to execute a command via PHP i get a permission denied error

    PHP Code:
    sh: /root/bin/ffmpegPermission denied 
    It sounds like you need a server management company, I would suggest you spend the money to have someone who knows what they are doing take care of the installation for you.

    The issue is for some reason you specified the /root path, something you should not have done in the first place. Recompile with the prefix /usr or without a prefix so that the binaries are installed in their default location (/usr/local - at least most of the time).

  5. #5
    Quote Originally Posted by alyak View Post
    99% apache running from another user , change permission to execute by everyone . 755

    chmod 755 /root/bin/ffmpeg

    may be will get problems with another files . do same .
    Not the best approach. It would, under most distributions, require you to change permissions on /root from 700 to something more permissive (701 at least).

    Your web server is running PHP as an ISAPI module. This is either running as user nobody or apache. Apache will not run as root - huge security risk.

    Since it's a binary shared by multiple users, recompile ffmpeg and install under /usr/local or /opt. You can do this by specifying the --prefix flag to configure, e.g.
    Code:
    ./configure --prefix=/usr/local && make && make install
    If install from source under /usr/local via ./configure, make, make install commands, then you would specify /usr/local/bin/ffmpeg.

    If you downloaded ffmpeg precompiled (binaries only), then move it to /opt/ffmpeg. In this situation, you'd change the path to /opt/ffmpeg/bin/ffmpeg.

Similar Threads

  1. Replies: 4
    Last Post: 01-22-2011, 12:21 PM
  2. PHP Access to Partition? "Permission Denied"
    By brandon272 in forum Programming Discussion
    Replies: 1
    Last Post: 08-28-2007, 07:32 PM
  3. Modernbill: Change From "WorldPay" to "Credit Card" on checkout.php as Payment O
    By A|J in forum Hosting Software and Control Panels
    Replies: 2
    Last Post: 10-06-2004, 03:38 PM
  4. Apache will always say "Permission Denied" when trying to use symlinks!
    By blasto333 in forum Hosting Security and Technology
    Replies: 1
    Last Post: 04-08-2003, 06:24 PM

Posting Permissions

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