HTML_ToPDF, I'm stuck some help please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sjaakie

    #1

    HTML_ToPDF, I'm stuck some help please

    Hi there,
    I'm trying to get HTML_ToPDF (3.3) running on en dedicated server,
    safe_mode enabled. Been trying for more than 2 days now, without success.
    Have similar script running on my own personal server. Safe mode disabled.

    This is what I did so far:
    ---
    I copied html2ps, ps2pdf and curl into
    /opt/guide/www.domain.inva lid/HTML/config/html2pdf/, directory also
    holds all HTML_ToPDF-files. Did chmod 777 to the specified folder.
    Temp-folder is /opt/guide/www.domain.inva lid/HTML/tmp (also 777).


    The script:
    ---
    // PDF (include class)
    @require_once($ _SERVER['DOCUMENT_ROOT']."/config/html2pdf/HTML_ToPDF.php" );
    $defaultDomain = "http://www.domain.inva lid";

    // PDF (path to html)
    $htmlFile = $_SERVER['DOCUMENT_ROOT']."/pdf/input.html";

    // PDF (path to pdf)
    $pdfFile = $_SERVER['DOCUMENT_ROOT']."/pdf/output.pdf";

    // PDF (settings)
    $pdf = new HTML_ToPDF($htm lFile, $defaultDomain, $pdfFile);
    $pdf->setDebug('true ');
    $pdf->setPs2Pdf('/opt/guide/www.domain.inva lid/HTML/config/html2pdf/ps2pdf');
    $pdf->setHtml2Ps('/opt/guide/www.domain.inva lid/HTML/config/html2pdf/html2ps');
    $pdf->setGetUrl('/opt/guide/www.domain.inva lid/HTML/config/html2pdf/curl
    -i');
    $pdf->setTmpDir('/opt/guide/www.domain.inva lid/HTML/tmp');
    $pdf->addHtml2psSett ings('break-table: 0');
    $result = $pdf->convert();


    Running the script returns:
    ---
    DEBUG: html2ps command run:
    /opt/guide/www.domain.inva lid/HTML/config/html2pdf/html2ps -f
    /opt/guide/www.domain.inva lid/HTML/tmp/CONF-4omnhC -o
    /opt/guide/www.domain.inva lid/HTML/tmp/PS-YJn3Ar
    /opt/guide/www.domain.inva lid/HTML/tmp/HTML-SDrxWw.html 2>&1
    DEBUG: html2ps output:
    DEBUG: config file: /opt/guide/www.domain.inva lid/HTML/tmp/CONF-4omnhC
    (not removed)
    DEBUG: html file:
    /opt/guide/www.domain.inva lid/HTML/tmp/HTML-SDrxWw.html (not removed)
    DEBUG: ps file: /opt/guide/www.domain.inva lid/HTML/tmp/PS-YJn3Ar (not
    removed)
    Error: there was a problem running the html2ps command. Error code
    returned: 127. setDebug() for more information

    ---
    DEBUG: html2ps output is empty, so I tried to execute the command from
    shell. Created a file test.php containing:
    <?
    exec('/opt/guide/www.domain.inva lid/HTML/config/html2pdf/html2ps -f
    /opt/guide/www.domain.inva lid/HTML/tmp/CONF-4omnhC -o
    /opt/guide/www.domain.inva lid/HTML/tmp/PS-YJn3Ar
    /opt/guide/www.domain.inva lid/HTML/tmp/HTML-SDrxWw.html 2>&1');
    ?>

    running '/>php test.php' returned;
    ---
    Error opening resource file:
    /opt/guide/www.domain.inva lid/HTML/tmp/CONF-N4OHnA
    *** Error opening /opt/guide/www.domain.inva lid/HTML/tmp/PS-JXAcZk for
    output

    The generated files in tmp-dir are owned by 'nobody:other', only nobody
    has rw-access, group other has r-access.

    Why can't php open the file?
    What actions to take to solve this?

    Thanks in advance!
Working...