{"id":124,"date":"2009-01-08T11:42:01","date_gmt":"2009-01-08T19:42:01","guid":{"rendered":"http:\/\/www.demonclownbaby.com\/?p=124"},"modified":"2009-01-08T11:42:01","modified_gmt":"2009-01-08T19:42:01","slug":"installing-pdflib-lite-on-linux","status":"publish","type":"post","link":"http:\/\/knoledge.org\/demon\/2009\/01\/08\/installing-pdflib-lite-on-linux\/","title":{"rendered":"Installing PDFlib Lite on Linux"},"content":{"rendered":"<p>I had some trouble, maybe if someone else has the same trouble I can help.<\/p>\n<p>1.  I downloaded the source code at <a href=\"http:\/\/www.pdflib.com\/download\/free-software\/pdflib-lite\/\">the pdflib site<\/a><\/p>\n<p>2.  I unpacked it and ran the configure and make commands and such.  So far so good.<\/p>\n<p>3.  I realized that unlike the full version, this doesn&#8217;t come with the php extension bindings.<\/p>\n<p>4.  Tried to use pear install pdflib like the instructions said, but that failed, so I tried pecl, but it claimed my gcc didn&#8217;t work:<\/p>\n<p># pear install pdflib<br \/>\nNo releases available for package &#8220;pear.php.net\/pdflib&#8221; &#8211; package pecl\/pdflib can be installed with &#8220;pecl install pdflib&#8221;<br \/>\nCannot initialize &#8216;pdflib&#8217;, invalid or missing package file<br \/>\nPackage &#8220;pdflib&#8221; is not valid<br \/>\ninstall failed<br \/>\n# pecl install pdflib<br \/>\ndownloading pdflib-2.1.5.tgz &#8230;<br \/>\nStarting to download pdflib-2.1.5.tgz (55,579 bytes)<br \/>\n&#8230;&#8230;&#8230;&#8230;.done: 55,579 bytes<br \/>\n10 source files, building<br \/>\nrunning: phpize<br \/>\nConfiguring for:<br \/>\nPHP Api Version:         20041225<br \/>\nZend Module Api No:      20060613<br \/>\nZend Extension Api No:   220060519<br \/>\n 1. path to pdflib installation? : <\/p>\n<p>1-1, &#8216;all&#8217;, &#8216;abort&#8217;, or Enter to continue: 1<br \/>\npath to pdflib installation? [] : \/usr\/local<br \/>\n 1. path to pdflib installation? : \/usr\/local<\/p>\n<p>1-1, &#8216;all&#8217;, &#8216;abort&#8217;, or Enter to continue:<br \/>\nbuilding in \/var\/tmp\/pear-build-root\/pdflib-2.1.5<br \/>\nrunning: \/root\/tmp\/pear\/pdflib\/configure &#8211;with-pdflib=\/usr\/local<br \/>\nchecking for egrep&#8230; grep -E<br \/>\nchecking for a sed that does not truncate output&#8230; \/bin\/sed<br \/>\nchecking for gcc&#8230; gcc<br \/>\nchecking for C compiler default output file name&#8230; a.out<br \/>\nchecking whether the C compiler works&#8230; configure: error: cannot run C compiled programs.<br \/>\nIf you meant to cross compile, use `&#8211;host&#8217;.<br \/>\nSee `config.log&#8217; for more details.<br \/>\nERROR: `\/root\/tmp\/pear\/pdflib\/configure &#8211;with-pdflib=\/usr\/local&#8217; failed<br \/>\n# <\/p>\n<p>So that failed.  I don&#8217;t know why, because my gcc does work.  Anyway, the solution was to start the pecl process, then open another terminal window and copy the \/root\/tmp\/pear\/pdflib\/ files to another directory.<\/p>\n<p>Then manually run configure &#8211;with-pdflib=\/usr\/local there.<\/p>\n<p>(I also ran into trouble because I wasn&#8217;t giving \/usr\/local as the directory.  I was giving \/usr\/local\/lib which was where libpdf.so was.  Trouble was, it needed pdflib.h which was in \/usr\/local\/include.  So giving \/usr\/local it knows to look both places.  The error code I was getting was:  configure: error: pdflib.h not found! Check the path passed to &#8211;with-pdflib=<PATH>. PATH should be the install prefix directory.)<\/p>\n<p>Then run make, then make test, then make install, and you&#8217;re done!  You should now have pdf.so in your php extension directory, which is extension_dir in your php.ini file.<\/p>\n<p>Hope that helps anyone googling for a solution based on error codes they&#8217;ve gotten.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had some trouble, maybe if someone else has the same trouble I can help. 1. I downloaded the source code at the pdflib site 2. I unpacked it and ran the configure and make commands and such. So far so good. 3. I realized that unlike the full version, this doesn&#8217;t come with the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/posts\/124"}],"collection":[{"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":1,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":125,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/posts\/124\/revisions\/125"}],"wp:attachment":[{"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/knoledge.org\/demon\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}