Forum


Replies: 5   Views: 4879
Conversion plugin not working
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by websurfermedia  · 23-11-2015 - 02:35

Hi Guys,

I recently upgraded to corporate and have spent all day trying to get the convcersion to pdf working.

Server is Apache on Linux, running cpanel and PHP 5.6.

I set up the debug script as per instructions at http://www.phpdocx.com/documentation/conversion-plugin/debugging-openoffice

The output is:

sh: ***********/Classes/Phpdocx/Transform/../../../lib/OdfConverter/64/OdfConverter: Permission denied
sh: java: command not found

Tried running directly.

lib/OdfConverter/64/OdfConverter
-bash: lib/OdfConverter/64/OdfConverter: Permission denied

I checked cpanel apache error logs, nothing about where to create the.wapi folder. Not sure where to do that.

Andrew

 

 

 

 

 

 

 

 

Posted by websurfermedia  · 23-11-2015 - 03:13

Update, I changed permissions on lib folder to 777. Now debug is

******/Classes/Phpdocx/Transform/../../../lib/OdfConverter/64/OdfConverter: error while loading shared libraries: libexif.so.12: cannot open shared object file: No such file or directory
sh: java: command not found

 

Posted by websurfermedia  · 23-11-2015 - 05:47

Ok, I managed to install java and the library. 

java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

Still not working. I tried running the following:

 lib/openoffice/openoffice.org3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
javaldx: Could not find a Java Runtime Environment!
no suitable windowing system found, exiting.

 

 

 

 

 

Posted by websurfermedia  · 23-11-2015 - 07:52

Ok, 8 hours later I have given up on openoffice and have tried installed Libreoffice.

I have managed to get this to work now from CLI follwing debug steps at http://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

However doesn't work from the web app. I gather it's permissions, but not shre what this means. The user I think is nobody, it's a cpanel server.

  • Needs to delete the possible blockage of SELinux or the blockage of the execution settings of external programs
  • Needs read and write permissions in the .config folder of the userĀ“s HOME directory

 

Posted by admin  · 23-11-2015 - 10:13

Hello,

Your issues working with OpenOffice, the most common source is SELinux, just try to stop it and try again. Or maybe your server is missing these libraries: libxt6 and libxrender1; please install both and try again.

About LibreOffice, you need to create the .config folder in the HOME path of the user and give 777 access. To know which folder is it, you can print it using PHP. And also grant config SELinux to be able to run external apps.

Regards.

Posted by websurfermedia  · 23-11-2015 - 23:45

I ended up getting Libreoffice working like this:

shell_exec('export HOME=/data/temp && /opt/libreoffice5.0/program/soffice --headless -convert-to pdf --outdir /data/temp/files /data/temp/files/test.docx');