When running this from command line as root it works
unoconv -f csv $file
But when running it as www-data this error is returned
Traceback (most recent call last):
File "/usr/bin/unoconv", line 1114, in <module>
office_environ(of)
File "/usr/bin/unoconv", line 203, in office_environ
os.environ['PATH'] = realpath(office.basepath, 'program') + os.pathsep + os.environ['PATH']
File "/usr/lib/python3.4/os.py", line 633, in __getitem__
raise KeyError(key) from None
KeyError: 'PATH'
update
echo shell_exec('echo $PATH');
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
www-data's$PATHand the root's$PATH? Try settingwww-data's path before running the command. See dirtyvital.wordpress.com/2012/11/11/….www-data's path?os.environdict. For example you could set it to.or a path to an empty directory.shell_exec-- are you using PHP? If so then please add that tag, and post the actual PHP code that contains the call. I have not used PHP before but maybe I can help.