{"id":1544,"date":"2022-08-30T15:17:25","date_gmt":"2022-08-30T15:17:25","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/wkhtmltopdf-issue-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:25","modified_gmt":"2022-08-30T15:17:25","slug":"wkhtmltopdf-issue-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/wkhtmltopdf-issue-collection-of-common-programming-errors\/","title":{"rendered":"wkhtmltopdf Issue-Collection of common programming errors"},"content":{"rendered":"<p>1) I uploaded&#8221;wkhtmltopdf-i386&#8243; to my server in a folder named &#8220;\/pdf&#8221;<\/p>\n<p>2) I uploaded the php integration script, in the same folder, and named it &#8220;wkhtmltopdf.php&#8221; (http:\/\/code.google.com\/p\/wkhtmltopdf\/wiki\/IntegrationWithPhp)<\/p>\n<p>3) I uploaded a file that I named &#8220;usage.php&#8221;, in the same folder, containing :<\/p>\n<pre><code>\n<\/code><\/pre>\n<p>4) I created a \/tmp folder with 777 permissions (all).<\/p>\n<p>When I load usage.php, I get the following error:<\/p>\n<pre><code>\"Fatal error: Uncaught exception 'Exception' with message 'WKPDF didn't return any data. <\/code><\/pre>\n<pre>' in \/home\/***\/public_html\/dev\/pdf\/wkhtmltopdf.php:205 Stack trace: #0 \/home\/***\/public_html\/dev\/pdf\/usage2.php(5): WKPDF-&gt;render() #1 {main} thrown in \/home\/***\/public_html\/dev\/pdf\/wkhtmltopdf.php on line 205\"\n<\/pre>\n<p><code>For your info, a html page is rendered in \/tmp folder each time I load usage.php.<\/code><\/p>\n<p><code>Do you have any clue on how to solve my issue?<\/code><\/p>\n<p><code>Thanks<\/code><\/p>\n<ol>\n<li>\n<p><code>Have you tried looking inside your <code>wkhtmltopdf.php<\/code>?<\/code><\/p>\n<p>Make sure that this line:<\/p>\n<pre><code>\/**\n * path to executable\n *\/\nprotected $_bin = '\/usr\/bin\/wkhtmltopdf';\n<\/code><\/pre>\n<p>is not <code>\/usr\/bin\/wkhtmltopdf<\/code> but is the absolute path where you put your <code>wkhtmltopdf-i386<\/code>.<\/p>\n<p>In your case, perhaps it&#8217;s <code>\/pdf\/wkhtmltopdf-i386<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-27 05:08:24. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>1) I uploaded&#8221;wkhtmltopdf-i386&#8243; to my server in a folder named &#8220;\/pdf&#8221; 2) I uploaded the php integration script, in the same folder, and named it &#8220;wkhtmltopdf.php&#8221; (http:\/\/code.google.com\/p\/wkhtmltopdf\/wiki\/IntegrationWithPhp) 3) I uploaded a file that I named &#8220;usage.php&#8221;, in the same folder, containing : 4) I created a \/tmp folder with 777 permissions (all). When I load [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1544","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1544"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1544\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}