I have installed libreoffice headless on a freebsd-server with apache in order to convert documents programmatically (e.g. odt->pdf). It works from the command line! But my
I was having the same problem and yes (thanks Wrikken) after prepending /usr/local/sbin to the PATH environment variable I was able to run libreoffice as www-data under apache.