0

I am unable to use unoconv to convert a .doc to PDF from php using exec. Here is what I am trying:

$output = exec("unoconv /opt/bitnami/apache2/htdocs/=".$fileData['name']);
error_log(print_r($output, TRUE));

This command, when run in the console works perfectly, but when run through php, it gives the following in the error logs:

python: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by python)
python: /opt/bitnami/common/lib/libssl.so.1.0.0: no version information available (required by python)
Aborted
[Thu Mar 28 20:13:58.312843 2013] [:error] [pid 1481] [client ***] 

I don't think the first two lines are relevant, and I'm not sure how to get more information on why it aborted. I also have tried running it using this wrapper stored in /usr/local/bin/unoconv.sh

#!/bin/bash

if [ -z "$1" ]; then
    echo "Must pass file";
    exit 10;
fi

/usr/bin/unoconv -f pdf $1.rtf

But that gives the error

python: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by python)
python: /opt/bitnami/common/lib/libssl.so.1.0.0: no version information available (required by python)
/usr/local/bin/unoconv.sh: line 8:  2886 Aborted                 /usr/bin/unoconv $1
[Thu Mar 28 20:17:05.331830 2013] [:error] [pid 1188] [client ***]

Any ideas on what else to try? Thanks for your help

14
  • distribution of linux/unix? Commented Mar 28, 2013 at 20:31
  • Sorry, it's Ubuntu 12.04.1 LTS Commented Mar 28, 2013 at 20:35
  • result of this: pkg-config --libs openssl? Commented Mar 28, 2013 at 20:35
  • No package 'openssl' found Commented Mar 28, 2013 at 20:38
  • run: apt-get install openssl and than: pkg-config --libs openssl, and check your script. Commented Mar 28, 2013 at 20:42

1 Answer 1

0

I've done it with exec();

$path_exe = "\"C:\Program Files (x86)\LibreOffice 4\program\python.exe\" c:\unoconv\unoconv -f png ";
exec('"C:\Program Files (x86)\LibreOffice 4\program\python.exe" c:\unoconv\unoconv -f pdf 'c:\'.$filename, $array_buffer, $code_error); 

You should specify the path to the python.exe, and the path to unoconv

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.