Skip to content

Commit

Permalink
Improved the section related to running unoconv through Nginx/Apache/PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Jul 7, 2015
1 parent 44c394c commit f9d31c9
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ or on Windows:

C:\Program Files (x86)\LibreOffice 3.5\program\python.exe unoconv -f pdf some-file.odt

NOTE: If you plan to use unoconv extensively (or in an automated fashion) it
is more efficient to use the correct python interpreter directly.
TIP: If you plan to use unoconv extensively (or in an automated fashion) it
is more efficient to use the correct python interpreter directly. Or event
put it directly in the Shebang (the first line) of the unoconv script !


== Using unoconv with no X display
Expand All @@ -115,14 +116,30 @@ No version of OpenOffice for MacOS X (3.4 is the current version) works because
the necessary internal files are not included inside the application.


== Problems running unoconv from Apache/PHP
== Problems running unoconv from Nginx/Apache/PHP
Some people have had difficulties using unoconv through webservices. Here
is a list of probable causes:
is a list of probable causes and recommendations:

- X display issues (may require the headless subpackage)
- Permission issues (unable to run or connect to LibreOffice or read/write)
- SELinux issues (SELinux prevents you from connecting to LibreOffice)
- Nginx/PHP-FPM issues (You can execute unoconv in terminal, but nothing happens when you use a PHP script. You may need to declare your PATH. Read https://github.com/dagwieers/unoconv/issues/87#issuecomment-18800070)
- Use the latest version of unoconv (or GitHub master branch)

- Use the most recent stable release of LibreOffice (less memory, more stable, fewer crashes)

- Use the native LibreOffice python binary to run unoconv

- Hardcode this native python path in the unoconv script shebang (or ensure PATH is set)

- Ensure that the user running unoconv has access to its HOME directory (ensure HOME is set)

- Test with SELinux in permissive mode

It is recomended to open the unoconv script and modify the very first line to
point directly to your installed LibreOffice python binary, so replace this:

#!/usr/bin/env python

with something like this:

#!/opt/libreoffice4.4/program/python

== Conversion problems
If you encounter problems converting files, it often helps to try again. If
Expand Down

0 comments on commit f9d31c9

Please sign in to comment.