I'm trying to create pdf's on the fly with php, but I'm getting errors such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing something to plug it into php.
Has anyone done this?
Mike
On Sat, Dec 30, 2006 at 05:09:57PM -0600, Mike Kercher enlightened us:
I'm trying to create pdf's on the fly with php, but I'm getting errors such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing something to plug it into php.
Has anyone done this?
Yes, the PDFlib in dag's repo isn't for php, if I remember correctly. I ended up building PDFlib-Lite from the website using the SRPM from pld linux, then updated the php-pecl-pdflib RPM from rpmforge (dag) to 2.1.2 and installed that.
I'm no longer using them in production, but I've still got spec files if you need some guidance.
Matt
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Matt Hyclak Sent: Saturday, December 30, 2006 10:01 PM To: CentOS mailing list Subject: Re: [CentOS] PDFlib?
On Sat, Dec 30, 2006 at 05:09:57PM -0600, Mike Kercher enlightened us:
I'm trying to create pdf's on the fly with php, but I'm
getting errors
such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing
something
to plug it into php.
Has anyone done this?
Yes, the PDFlib in dag's repo isn't for php, if I remember correctly. I ended up building PDFlib-Lite from the website using the SRPM from pld linux, then updated the php-pecl-pdflib RPM from rpmforge (dag) to 2.1.2 and installed that.
I'm no longer using them in production, but I've still got spec files if you need some guidance.
Matt
--
Matt,
Thanks for the info. I would be very interested in your .spec files and any other guidance you may have.
Mike
On Sun, Dec 31, 2006 at 10:25:07AM -0600, Mike Kercher enlightened us:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Matt Hyclak Sent: Saturday, December 30, 2006 10:01 PM To: CentOS mailing list Subject: Re: [CentOS] PDFlib?
On Sat, Dec 30, 2006 at 05:09:57PM -0600, Mike Kercher enlightened us:
I'm trying to create pdf's on the fly with php, but I'm
getting errors
such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing
something
to plug it into php.
Has anyone done this?
Yes, the PDFlib in dag's repo isn't for php, if I remember correctly. I ended up building PDFlib-Lite from the website using the SRPM from pld linux, then updated the php-pecl-pdflib RPM from rpmforge (dag) to 2.1.2 and installed that.
I'm no longer using them in production, but I've still got spec files if you need some guidance.
Matt
Matt,
Thanks for the info. I would be very interested in your .spec files and any other guidance you may have.
Sorry, I've been out with the holidays and all. I've attached the src.rpm for php-pecl-pdflib and a .nosrc.rpm for PDFLib-Lite. You'll have to download PDFLib-Lite 6.0.3 from their website to rebuild, but that should get you in the right direction.
HTH,
Matt
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Matt Hyclak Sent: Tuesday, January 02, 2007 1:00 PM To: CentOS mailing list Subject: Re: [CentOS] PDFlib?
On Sun, Dec 31, 2006 at 10:25:07AM -0600, Mike Kercher enlightened us:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Matt Hyclak Sent: Saturday, December 30, 2006 10:01 PM To: CentOS mailing list Subject: Re: [CentOS] PDFlib?
On Sat, Dec 30, 2006 at 05:09:57PM -0600, Mike Kercher
enlightened us:
I'm trying to create pdf's on the fly with php, but I'm
getting errors
such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing
something
to plug it into php.
Has anyone done this?
Yes, the PDFlib in dag's repo isn't for php, if I remember correctly. I ended up building PDFlib-Lite from the website using the SRPM from pld linux, then updated the php-pecl-pdflib
RPM from
rpmforge (dag) to 2.1.2 and installed that.
I'm no longer using them in production, but I've still got spec files if you need some guidance.
Matt
Matt,
Thanks for the info. I would be very interested in your
.spec files
and any other guidance you may have.
Sorry, I've been out with the holidays and all. I've attached the src.rpm for php-pecl-pdflib and a .nosrc.rpm for PDFLib-Lite. You'll have to download PDFLib-Lite 6.0.3 from their website to rebuild, but that should get you in the right direction.
HTH,
Matt
--
Thanks for all of the help guys! I think I actually got it working yesterday by doing a pear install pdflib and then installing a php-pecl-pdflib rpm for FC3. I'm going to try rebuilding these .src.rpm's so I have a cleaner installation.
Thanks again!
Mike
On Saturday 30 December 2006 15:09, Mike Kercher wrote:
I'm trying to create pdf's on the fly with php, but I'm getting errors such as:
Fatal error: Call to undefined function: pdf_new()
I tried installing pdflib from dag, but I think I'm missing something to plug it into php.
Has anyone done this?
Simply installing the back end library that PHP uses isn't enough to add support to PHP for that library. PHP either has to be compiled with support for it (which you could do by getting the source RPM and modifying the spec file), finding someone who has already done this for CentOS/RHEL (http://phprpms.sourceforge.net/, dag, kbsingh) or support needs to be compiled in later through some other process such as PECL (http://pecl.php.net). If the all you need is pdflib support and you can't find it in any of the pubic repos, PECL may be the easiest for you.
http://pecl.php.net/package/pdflib contains the linking functions for pdflib and PHP. Make sure pdflib is installed, download the PECL package and use phpize (in php-devel rpm) in the source directory to make it usable for your php installation.
Note: I actually tried this, and I was getting an error from the PECL pdflib package about pdflib needing to be at least version 4, even though version 6 (libpdf.so.5?) was installed from Dag's repo. You might have to do a little groundwork beyond what I outlined to get this to work...