Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run unoconv from PHP #42

Closed
brianvic opened this issue Feb 21, 2012 · 3 comments
Closed

Unable to run unoconv from PHP #42

brianvic opened this issue Feb 21, 2012 · 3 comments

Comments

@brianvic
Copy link

I've checked as many of the similar errors as I can, but nothing seems to match.

I have installed LibreOffice3.4 on RHEL5. I was unable to install unoconv via RPM or YUM so have used the SVN file and set it up manually. I can convert files via the command line without issue. It works well converting just about any format to PDF.

When I try to run the same command from PHP it just fails. I captured its output and the error is 'Cannot find a suitable pyuno library and python binary combination in /opt/libreoffice3.4' and '(RuntimeException):cannot open file:///root/.ure/types.rdb unoconv: Cannot find a suitable office installation on your system'.

PHP is running under Apache so shouldn't it be looking in the Apache home directory for files? And if so why is it trying to use root? Perhaps my manual setup is missing something? Or is there something I am unaware of in Apache?

For unoconv I didn't really do anything except place the file in /usr/bin. It will run from the command line whether I just enter unoconv or the full path to it. I can't log in as Apache to test if it would work or not.

Any pointers or advice?

Cheers!

@dagwieers
Copy link
Member

You said you used the SVN file ? You meant you downloaded it from Github, right ?

I don't know why it is looking inside file:///root, that's LibreOffice at work. But:

  • Make sure you use the latest version
  • You may want to instruct php to run the LibreOffice python directly, rather than have unoconv switch python on each invocation
  • You may want to influence the location of LibreOffice using the UNO_PATH variable
  • Did you read the documentation ? There are some hints and tips on what is needed to run from PHP
  • Running unoconv manually from the user apache might give some clues
  • Make sure that the security context of selinux allows what you want to do

@dagwieers
Copy link
Member

There is now a "Troubleshooting instructions" section in the main README file that could be of help.

@dagwieers
Copy link
Member

Closing this issue. Feel free to reopen this issue if it is still valid or you care about it more than I do.

If you want help, you need to provide information, otherwise you're just wasting other people's time. And time is what I do not have plenty of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants