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

How to get php-unoconv / unoconv working for Ubuntu 14.04? #4

Open
simkimsia opened this issue Mar 3, 2016 · 1 comment
Open

How to get php-unoconv / unoconv working for Ubuntu 14.04? #4

simkimsia opened this issue Mar 3, 2016 · 1 comment

Comments

@simkimsia
Copy link

Most times, any issue with using php-unoconv actually lies in the interaction between unoconv, the libreoffice/openoffice, and the operating system's python modules.

I think to increase more adoption for this php-unoconv, it is good to add more documentation around the area of installing unoconv, libreoffice/openoffice, and the operation system.

I can contribute to the use of this in Ubuntu 14.04 64-bit Server edition using Python 2.7

  1. git clone directly from the unoconv repo. Forget about ever using the packages standard unoconv. It is usually broken.
  2. copy the unoconv file into the /usr/bin/unoconv
  3. Uninstall all versions of open office and libreoffice and follow this https://gist.github.com/luw2007/d5ce9b5e5a27be77054a. Stop at step 4.
  4. Use this test script to make sure that unoconv itself is okay.

testunoconv.php

putenv('HOME=/var/www/');

    $command = 'echo $HOME &  unoconv -vvvv --format %s --output %s %s 2>full_path_to_output.txt';
    $command = sprintf($command, 'pdf', 'full_path_to_output.pdf', 'full_path_to_input.docx');
    exec($command, $output, $result_var);
  1. Look for the output.txt and you should expect to see something like this:
Verbosity set to level 4
DEBUG: Connection type: socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /opt/openoffice4/program/soffice.bin.
Input file: full_path_to_input.docx
DEBUG: Terminating OpenOffice instance.
DEBUG: Waiting for OpenOffice instance to exit.
  1. Even if you don't see this, there will be some useful error messages that you can use to google your way out of this. I highly recommend that php-unoconv include this as a function somewhere for testing purposes. I couldn't have solved the issue without this logger. The logger example given did not set verbosity to vvvv
  2. Once you can get unoconv to work, it is matter of using php-unoconv
@simkimsia
Copy link
Author

I honestly think that php-unoconv should replicate the step for high verbosity logging of the unoconv

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