ABHI
ABHI

Reputation: 132

On Amazon Instance Libreoffice PDF conversion command not working

Libreoffice PDF conversion command not working on Amazon instance.

I have got the below mentioned scenario. When I am executing same command through root user then its executing on command line but when I am executing same command as Apache user its giving error!!

Executing command with Root user.

/opt/libreoffice/program/soffice --headless --nologo --nofirststartwizard --norestore --convert-to pdf:writer_web_pdf_Export --outdir '/var/www/html/con/var/tmp' '/var/www/html/con/var/tmp/imagick-tmp-5e3a4b08d044d.xls'

Msg after execution above command with root user

/opt/libreoffice/program/soffice.bin: /lib64/libdbus-1.so.3: no version information available (required by /opt/libreoffice/program/libmergedlo.so)
  convert /var/www/html/con/var/tmp/imagick-tmp-5e3a4b08d044d.xls -> /var/www/html/con/var/tmp/imagick-tmp-5e3a4b08d044d.pdf using filter : writer_web_pdf_Export

Executing command with Apache user.

-uapache /opt/libreoffice/program/soffice --headless --nologo --nofirststartwizard --norestore --convert-to pdf:writer_web_pdf_Export --outdir '/var/www/html/con/var/tmp' '/var/www/html/con/var/tmp/imagick-tmp-5e3a4b08d044d.xls'

Msg after execution above command with Apache user.

javaldx failed!
Warning: failed to read path from javaldx
/opt/libreoffice/program/soffice.bin: /lib64/libdbus-1.so.3: no version information     available (required by /opt/libreoffice/program/libmergedlo.so)
LibreOffice 6.2 - Fatal Error: The application cannot be started.
User installation could not be completed.

I have checked all the installation and permission related things. Everything is fine. Please help!

Upvotes: 0

Views: 970

Answers (1)

ABHI
ABHI

Reputation: 132

Finally I have got the solution, mentioned below.

Actual Command :-

export HOME=/var/www && /usr/bin/soffice --headless --nologo --nofirststartwizard --norestore  --convert-to pdf:writer_web_pdf_Export  --outdir '/var/www/html/pimcore_root/var/tmp' '/var/www/html/pimcore_root/web/var/assets/demo.xls'

Modified Command :-

export HOME=/var/www && /usr/bin/soffice --headless --nologo --nofirststartwizard --norestore  -env:UserInstallation=file:///tmp/LibreOffice_Conversion_${USER} --convert-to pdf:writer_web_pdf_Export  --outdir '/var/www/html/pimcore_root/var/tmp' '/var/www/html/pimcore_root/web/var/assets/demo.xls'

In modified command we have added " -env:UserInstallation=file:///tmpLibreOffice_Conversion_${USER} "

and after that everything is working fine.

Upvotes: 1

Related Questions