anttiviljami / wp-pdf-templates

Add PDF templates to your WordPress theme
https://wordpress.org/plugins/wp-pdf-templates
GNU General Public License v3.0
42 stars 18 forks source link

WordPress PDF Templates 'DOMPDF_Exception' #4

Closed gowthamSelvaraj closed 9 years ago

gowthamSelvaraj commented 9 years ago

This error occurs in production server the same works fine in local server. Please do the needful ASAP.

Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Requested HTML document contains no data.' in /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/dompdf/include/frame_tree.cls.php:122 Stack trace: /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/dompdf/include/dompdf.cls.php(676): Frame_Tree->build_tree() /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/dompdf/include/dompdf.cls.php(846): DOMPDF->_process_html() /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php(332): DOMPDF->render() /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php(239): _print_pdf('') [internal function]: _use_pdf_template('') /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-includes/plugin.php(496): call_user_func_array('_use_pdf_templa...', Array) /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-includes/temp in /home/vol12_6/byethost8.com/b8_16145668/htdocs/wp-content/plugins/wp-pdf-templates/dompdf/include/frame_tree.cls.php on line 122

anttiviljami commented 9 years ago

looks like your production server can't access itself via HTTP. does DNS resolve your address correctly? can you CURL your site from your production machine?

gowthamSelvaraj commented 9 years ago

Yes i can

<?php

$ch = curl_init("http://horsepower.byethost8.com/");
$fp = fopen("example_homepage.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
anttiviljami commented 9 years ago

curious, i can't really say what the issue could be without more debug information. it just looks like your web server is returning an empty document for the /pdf-template endpoint

maraujo010 commented 9 years ago

I have the same error after migrating to another server...

anttiviljami commented 9 years ago

This is a server configuration error, not a plugin problem. Please make sure that your server can query your WordPress site via http and https, and that SSL is configured correctly.

maraujo010 commented 9 years ago

thank you for your answer. For sure It's not a plugin error, but in order to use it i have to find how to solve the problem.

1- It works in my dev server (myserver.net) even if i can't query wordpress via http and https

2- My client server is in a subdomain (wordpress.myclient.net). After reading you answer i founded that the subdomain wordpress.myclient.net is not accessible thru www.wordpress.myclient.net. This misconfiguration might be the problem.

anttiviljami commented 9 years ago

Check your server error and access logs to see what the issue could be. Most likely a simple hostsfile change, or a search-replace in your database will do the trick.

maraujo010 commented 9 years ago

solved. The problem was that my client's server had the option allow_url_fopen = Off. It must be On, otherwise file_get_contents won't work.

anttiviljami commented 9 years ago

Thanks for sharing your solution!