shell exec permissions

Discussion in 'ISPConfig 3 Priority Support' started by arraken, Mar 24, 2015.

  1. arraken

    arraken Member

    I am running into problems with shell_exec. I want to convert a *.doc file into png with libreoffice. The .doc file lies within the files folder of a drupal website.

    The command I want to execute (in a php file) is the following:

    I added the following to the suders file with visudo, in order to be able to call the libreoffice command:
    web2 ALL=(root) NOPASSWD: /usr/bin/libreoffice

    web2 is the php user (I use nginx + php-fpm)
    I can call the /usr/bin/libreoffice command, however, I always get the following output from libreoffice:

    So apparently the *.doc file can't be accessed. In my development box the command works fine. I use a vagrant box with nginx + php-fpm. So I guess the problem lies with some stricter access rules in Ispconfig. Any Idea how I can make this work with ISPConfig?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Php is running as web user and the web user has full access rights, so it is unlikely that this is a petmission problem of the doc file. Especially as you run the command as root and root can ess any folder of your server.
  3. arraken

    arraken Member

    yes, I thought so too. But I think it is is somehow related to ispconfig permissions. I just copied the website into /var/www/ (manually on the shell) and created a file manually in /etc/nginx/sites-enabled, and in there it works just fine.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Maybe openoffice performs some other checks and not just tries to open the file. You can try to remove the immutable bit from the web root and then do a chmod 755 on the web directory.
    DDArt and arraken like this.
  5. arraken

    arraken Member

    THE IMMUTABLE BIT!! It strikes once again... after removing it, it works like a charm. Thanks till.. even late at night you are the saviour of the tired sysadmin. :)

Share This Page