Find the answer to your Linux question:
Results 1 to 2 of 2
I am stumped on something and hoping you all can help. I have need for a LAMP server to print directly from a webpage without the dialog box. So I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175

    Apache user can't run libreoffice --headless


    I am stumped on something and hoping you all can help. I have need for a LAMP server to print directly from a webpage without the dialog box. So I installed CUPS and mapped the printers. I am printing .docx files so I was using the libreoffice --headless command to print using a shell script. Everything was working great until today. All of a sudden clicking the button to kick off the script failed, and after much troubleshooting, I have traced the issue back to the apache user having an issue running libreoffice --headless

    I used it at the CLI and it returns to a new line with no error, but no job gets submitted to CUPS. If I re-direct output to a file, all I get is a blank file

    commands I am using are:
    libreoffice --headless -pt PrinterQueue FileName
    or
    libreoffice --headless -pt PrinterQueue FileName > testfile

    I have double-checked the PATH variable as well to make sure that was ok and it is.

    Any ideas?

  2. #2
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    So I figured this out after much tinkering. The Libreoffce --headless command needs to have a writeable temp directory and uses the users HOME directory for this. I need to put export HOME=/apache/writeable/directory (e.g. export HOME=/var/www/printstore) and the script runs like a champ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •