Hola, estoy haciendo un generador de facturas on-line con la clase dompdf. Lo hago mediante load_html_file(""), pero me da este error, he habilitado el allow_url_fopen y deshabilitado el safe_mode, no se si es por aquí el error. Escribo el error:
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/home/bit-one.eu/:/usr/home/phpMyAdmin-plan6/:/usr/home/webstats/) in /usr/home/bit-one.eu/web/01solution/01mediaCRM/classpdf/include/image_cache.cls.php on line 105
Warning: unlink() [function.unlink]: No such file or directory in /usr/home/bit-one.eu/web/01solution/01mediaCRM/classpdf/include/image_cache.cls.php on line 153
Unable to stream pdf: headers already sent
El código:
date_default_timezone_set('Europe/Madrid');
require_once("classpdf/dompdf_config.inc.php");
$url="http://www__________billing.php?iden=".$iden;
$dompdf = new DOMPDF();
//$dompdf->load_html($html);
$dompdf->load_html_file($url);
$dompdf->output();
$dompdf->render();
$dompdf->stream("report.pdf");
file_put_contents("report.pdf", $dompdf->output());
Sabéis si os ha pasado ?
saludos y gracias!!
He solucionado parcialmente el problema pero ahora me da otro.
SOLUCIÓN: configurar en el archivo dompdf_config.inc.php define("DOMPDF_TEMP_DIR", "/home/dominio.com/tmp"); ya que tmp es un directorio creado por nosotros o por el server para la temporalidad. Esto bien ahora me sale este:
Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/home/bit-one.eu/tmp/tmp1UYomf) is not within the allowed path(s): (/usr/home/bit-one.eu/:/usr/home/phpMyAdmin-plan6/:/usr/home/webstats/) in /usr/home/bit-one.eu/web/01solution/01mediaCRM/classpdf/include/image_cache.cls.php on line 135
Unable to stream pdf: headers already sent
Poco a poco lo sacaremos, si alguien puede aportar alguna cosa, de lujo. saludos