The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to write to destination /tmp

Discussion in 'Workarounds and Optimization' started by thorny23, Feb 18, 2016.

  1. thorny23

    thorny23 Registered

    Joined:
    Oct 31, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    Im just reaching out here as i seem to have exhausted all other avenues.

    We have installed the wkhtmltopdf package on our cPanel server to generate PDF's on the fly, all was working perfectly on our old server but a fault on that meant we had to move. Since the migration we have been getting the following when a PDF is trying to be generated:

    Code:
    PHP Fatal error:  Uncaught exception 'Exception' with message 'Could not create PDF: Could not run command /usr/local/bin/wkhtmltopdf --margin-top '0' --margin-right '5' --margin-bottom '0' --margin-left '5' --image-quality '100' --viewport-size '1280x1024' 'http://www.domainname.com/vehicle/single-vehicle-pdf.php?id=242' '/tmp/tmp_wkhtmlto_pdf_2yhUV3.pdf'
    If i ssh in as root and try and generate the PDF via command line it works fine, generating the file and passing all tests. If i login as a standard cPanel user via shell and try it im getting the same "Error: Unable to write to destination"

    Any help would be greatly appreciated!
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    What is the permission of your /tmp directory ? Please setup 1777 permission to your /tmp directory OR change your output path in your wkhtmltopdf comamnd.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page