Hi! 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?
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.
Hi, yes, I thought so too. But I think it is is somehow related to ispconfig permissions. I just copied the website into /var/www/testdomain.at (manually on the shell) and created a testdomain.at.vhost file manually in /etc/nginx/sites-enabled, and in there it works just fine.
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.
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.