You are here: HTML_ToPDF, I'm stuck some help please « PHP Programming Language « IT news, forums, messages
HTML_ToPDF, I'm stuck some help please

Posted by Sjaakie on 10/15/26 11:24

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.invalid/HTML/config/html2pdf/, directory also
holds all HTML_ToPDF-files. Did chmod 777 to the specified folder.
Temp-folder is /opt/guide/www.domain.invalid/HTML/tmp (also 777).


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

// 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($htmlFile, $defaultDomain, $pdfFile);
$pdf->setDebug('true');
$pdf->setPs2Pdf('/opt/guide/www.domain.invalid/HTML/config/html2pdf/ps2pdf');
$pdf->setHtml2Ps('/opt/guide/www.domain.invalid/HTML/config/html2pdf/html2ps');
$pdf->setGetUrl('/opt/guide/www.domain.invalid/HTML/config/html2pdf/curl
-i');
$pdf->setTmpDir('/opt/guide/www.domain.invalid/HTML/tmp');
$pdf->addHtml2psSettings('break-table: 0');
$result = $pdf->convert();


Running the script returns:
---
DEBUG: html2ps command run:
/opt/guide/www.domain.invalid/HTML/config/html2pdf/html2ps -f
/opt/guide/www.domain.invalid/HTML/tmp/CONF-4omnhC -o
/opt/guide/www.domain.invalid/HTML/tmp/PS-YJn3Ar
/opt/guide/www.domain.invalid/HTML/tmp/HTML-SDrxWw.html 2>&1
DEBUG: html2ps output:
DEBUG: config file: /opt/guide/www.domain.invalid/HTML/tmp/CONF-4omnhC
(not removed)
DEBUG: html file:
/opt/guide/www.domain.invalid/HTML/tmp/HTML-SDrxWw.html (not removed)
DEBUG: ps file: /opt/guide/www.domain.invalid/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.invalid/HTML/config/html2pdf/html2ps -f
/opt/guide/www.domain.invalid/HTML/tmp/CONF-4omnhC -o
/opt/guide/www.domain.invalid/HTML/tmp/PS-YJn3Ar
/opt/guide/www.domain.invalid/HTML/tmp/HTML-SDrxWw.html 2>&1');
?>

running '/>php test.php' returned;
---
Error opening resource file:
/opt/guide/www.domain.invalid/HTML/tmp/CONF-N4OHnA
*** Error opening /opt/guide/www.domain.invalid/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!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация