Forum


Replies: 7   Views: 11523
You're not running openoffice in headless mode on port 8100
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 bruce  · 19-03-2014 - 12:27

hello



we purchased a pro+  license few days ago but we have a problem using the PDF conversion plugin.



when I run check.php, I got a  warning  'You're not running OpenOffice in headless mode on port 8100.



I have run the command  /opt/openoffice4/program/soffice -headless -accept="socket,host=localhost,port=8100;urp;"  -nofirststartwizard 



my centos version is 6.5 x86_64   and  I installed the 64-bit version of openoffice4 .   openoffice installed under the opt directory



I have done below, install glibc.i686, libstdc++.i686, xulrunner.i686



In that case you need to install some 32bits libraries to get this compatibility. If you’re using Debian or Ubuntu just install ia32-libs package; and if you’re using RedHat or CentOS install these packages: glibc.i686, libstdc++.i686, xulrunner.i686.



How to make openoffice run as headless mode , I have read http://www.phpdocx.com/help/conversion-plugin-docx-to-pdf



thanks



PHP_VERSION: 5.3.3

PHP_OS: Linux

PHP_UNAME: Linux kvm85 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64

CODE: 

SERVER_NAME: 192.168.0.87

SERVER_SOFTWARE: Apache/2.2.15 (CentOS)

SERVER_ADDR: 192.168.0.87

SERVER_PROTOCOL: HTTP/1.1

HTTP_HOST: 192.168.0.87

HTTP_X_FORWARDED_FOR: 

PHP_SELF: /phpdocx/check.php

XSLTProcessor: 1

ZipArchive: 1

DomDocument: 1

SimpleXMLElement: 1

Tidy: 1

IS_WRITABLE DEFAULT TEMP: 1



 


Posted by jorgelj  · 19-03-2014 - 12:47

Hello,



After starting OpenOffice in headless mode run this command and post the output:



$ ps aux | grep openoffice



Regards.


Posted by bruce  · 20-03-2014 - 02:33

hello



/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststar

twizard



[root@kvm85 ~]# netstat -ano | grep 8100

tcp        0      0 127.0.0.1:8100              0.0.0.0:*                   LISTEN      off (0.00/0/0)

[root@kvm85 ~]# ps aux | grep soffice

root      1280  0.0  0.1 106060  1388 pts/0    S+   09:11   0:00 /bin/sh /opt/openoffice4/program/soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

root      1289  0.0  5.6 609800 57364 pts/0    Sl+  09:11   0:00 /opt/openoffice4/program/soffice.bin -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

root      1338  0.0  0.0 103244   832 pts/1    R+   09:18   0:00 grep soffice



[root@kvm85 ~]# 



require_once '../../classes/CreateDocx.inc';



$docx = new CreateDocx();



$docx->enableCompatibilityMode();



$docx->addTemplate('../files/TemplateText.docx');



$docx->addTemplateVariable('WEIGHT1', '10');

$docx->addTemplateVariable('WEIGHT2', '20');

$docx->addTemplateVariable('WEIGHT3', '25');



$docx->addTemplateVariable('PRICE1', '5');

$docx->addTemplateVariable('PRICE2', '30');

$docx->addTemplateVariable('PRICE3', '7');



$docx->addTemplateVariable('TOTALWEIGHT', '55');



$docx->addTemplateVariable('TOTALPRICE', '42');



$docx->addTemplateVariable('NAME',

                           '<strong>David Hume</strong><br />

                           <em>Character is the result of a system of stereotyped principles.</em>',

                           'html');



$docx->createDocx('../docx/example_template_html');





$document = new TransformDoc();



$docx->transformDocx('../docx/example_template_html.docx', '../docx/example_template_html.pdf');



The docx directory has example_template_html.docx but no example_template_html.pdf



check.php still said that You're not running OpenOffice in headless mode on port 8100.



what should I do ?



thanks a lot



 



 


Posted by ellytronic  · 20-03-2014 - 08:05

CentOS6.5 does not have an OOo headless package. You'll need to use LibreOffice (basically the new version of OpenOffice). We just had the same issue on our CentOS machine. 


Posted by bruce  · 22-03-2014 - 12:24

hello ellytronic, 



I have tried to install libreoffice4.2 and  run the command  /opt/libreoffice4.2/program/soffice -headless -accept="socket,host=localhost,port=8100;urp;"  -nofirststartwizard  ,but the check.php still said that You're not running OpenOffice in headless mode on port 8100 , How do you let libreofice run in headless mode 



please help


Posted by jorgelj  · 24-03-2014 - 09:14

Hello,



As you check on the readme, we recommend to use OpenOffice because LibreOffice has some issues running on headless mode.



As you're already running OpenOffice:



[root@kvm85 ~]# ps aux | grep soffice

root      1280  0.0  0.1 106060  1388 pts/0    S+   09:11   0:00 /bin/sh /opt/openoffice4/program/soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

root      1289  0.0  5.6 609800 57364 pts/0    Sl+  09:11   0:00 /opt/openoffice4/program/soffice.bin -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

root      1338  0.0  0.0 103244   832 pts/1    R+   09:18   0:00 grep soffice



run the included example, advanced/Transform.php, using the CLI mode:



$ php Transform.php



Enablig the debug mode and post the output. Please check that SELinux or a firewall aren't blocking the access to OpenOffice.



Regards.


Posted by ellytronic  · 25-03-2014 - 22:24

Bruce,



We still get the error message from check, but the script seems to work okay. We're still in development though, so I can't say that no issues will come up. What I can say, is that I have found no hope for making Open Office work for headless mode on CentOS6.5. You'd need to roll back to CentOS5