Permissions question

Discussion in 'General' started by biobrew, Jul 11, 2008.

  1. biobrew

    biobrew New Member

    I have a client who has a website on my debian etch with ispconfig server, this client has shell access and admin access.

    He has a script that makes some shell calls, all of shell calls work except for one that reads a .doc file and converts into .txt file using the linux command line tool antiword

    I installed antiword for him in /var/www/web1/web/bin/antiword and gave that directory and antiword www-data ownership and write and execute permissions

    the files are read and written to in /var/www/web1/web/uploads

    when I do:

    su www-data

    and run antiword from the command line it will read the .doc file and convert it into a text file just fine, e.g.

    /path/to/antiword /path/to/docfile > /path/to/txtfile

    And that works just fine

    But using from php:

    system("/path/to/antiword /path/to/docfile /path/to/txtfile");

    Will in fact output a text file, but it will be 0 bytes in length.

    Does that make any sense at all?
     
  2. biobrew

    biobrew New Member

    Another thing that I just realized that is a little weird, i'm trying to run pdftohtml from php and I get a strange error message.

    but when I su www-data and run it, it works just fine. I'm not really sure how to make it so my client can run programs from the command line that read and write files to his directories.
     
  3. biobrew

    biobrew New Member

    1 more thing, this used to work before I moved the site to ispconfig, so I'm pretty sure it's a permissions problem and not a problem with the script.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you use suphp or do you have php safemode enabled?
     
  5. biobrew

    biobrew New Member

    nope && nope

    Should I?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Shouldn't it read
    Code:
    system("/path/to/antiword /path/to/docfile [B][COLOR="Red"]>[/COLOR][/B] /path/to/txtfile");
    ?
     
  7. biobrew

    biobrew New Member

    It does, sorry for my typo. I should say that the code all worked perfectly before moving to ispconfig.

    I kind of figure it out though. I moved antiword and the other linux command line tools needed to be called from php into a directory off of the webroot for that user, and chowned those 3rd party programs as www-data and gave www-data chmod u+x permissions and now it seems to work. It's still a little wonky but I can work around it now.
     

Share This Page