unable to run oowriter as web user
java, libreoffice, ubuntu, webusercontrol
Solution
Can't vote, can't comment (yet)... So...
What Tim-Erwin said is true.
The error actually states that Error in function createSettingsDocument which is a hint that some function named createSettingsDocument (note: create Settings Document) is failing....
Here's how you (or atleast I) get it to work:
- Run libre office as a normal user once and note the directory name it creates.
- Check which user the server is running (or which user PHP is running as, which might be different from www-data if you're on FPM etc...).
- Check what the home directory is set to for this user (from /etc/passwd for example)
- Create the directory noted in step 1 in the directory from step 3
- Change owner of created directory to the user from step 2
On my server the needed directory was actually /var/www/libreoffice, while in my desktop machine,the directory would of been /var/www/.config/libreoffice so you need to make sure.
Problem
I have a web server set up on my laptop. I am building a web application which I am accessing through the local network. I have a php file which contains the following lines: ``` $command = "/usr/bin/oowriter --invisible --convert-to pdf /var/www/hackathon/document/gaurav.doc -outdir /var/www/hackathon/pdf/" exec($command, $output, $return_var); print_r($output); ``` So, the problem is that when I run the above code in the terminal php runs perfectly. But when accessed via a web browser, output is just empty and no conversion is done as intended. Apache error log shows the following lines: [Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed! Warning: failed to read path from javaldx I have tried solutions from https://wiki.archlinux.org/index.php/Libreoffice#Fixing_Java_Framework_Error. But it didn't work. I am using OpenJDK 7. Does anybody have any idea on how to make this work?