Click to See Complete Forum and Search --> : PHP-PDF


Anon
02-13-2001, 08:17 AM
I have a little problem, i need to translate a document into PDF format, with images and text, using PHP.
I read the manual and I have the required library, but isn’t right!!!!

I need to install all in a server LINUX and after testing…

Can you give me more information? What I need for the installation and where I find it?

Much thanks
Please answer soon.

Sabrina

Anon
02-13-2001, 09:40 AM
What kind of Linux system? What PHP version?

smarlowe
02-13-2001, 01:12 PM
First, you need to go here:

www.php.net/pdf

and read up on how to get pdf working.

Download the latest version of libpdf from the site listed in the docs, build and install it. If it installs library files to /usr/local/lib (like I think it does) then you'll need to edit the /etc/ld.so.conf file to have an entry for that directory and then run ldconfig to make the machine aware of the pdflib being there.

Then php should be able to work with the --with-pdflib switch without a path.

Anon
02-14-2001, 06:33 AM
the Linux version in 6.2 redhat
and the PHP Version 3.0.15.

I follow the manual ad I downloading alle the required Library..
What must I do?

Please.. very very simple.. I'm not English...

Thanks a lot...

sabrina

smarlowe
02-14-2001, 10:19 AM
There's more than one way to do this, but I'll just do it my way and we'll see if that works. I'll assume you're running a Gnu type os like Linux or freebsd

First, download the apache, php and pdflib source tar balls from their respective sites. I usually do this as root and place them into a subdirectory of /root called gz for gzipped files.

Now, as root:

]# cd /usr/local/src
]# tar -xvzf /root/gz/apache*gz
]# tar -xvzf /root/gz/php*gz
]# tar -xvzf /root/gz/pdflib*gz

This should create three directories each with the source code for their respective products.

Now, cd in apache first, and make it like so:

]# cd /usr/local/src/apache*
]# ./configure --enable-module=most --enable-shared=max
]# make
]# make install

This will make a default DSO apache install and place the apache installation into the default /usr/local/apache directory.

Then, move to the pdflib directory and install it:

]# cd /usr/local/src/pdf*
]# ./configure --enable-cxx --enable-shared-pdflib
]# make
]# make install

This will make the pdf library and install is as libpdf.so into the /usr/local/lib directory. Check your /etc/ld.so.conf file to see that it includes the /usr/local/lib directory in it. If not, add a line that says /usr/local/lib to it and run ldconfig. This will add the /usr/local/lib directory to the system search path for shared libs.

Next we configure php (the hard part...)

]# cd /usr/local/src/php*
]# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-pdflib | tee config.log

Before we continue, type:

]# less config.log

and check to see if pdflib was found and configured or not. If so:

]# make
]# make install

should finish the install. Now just type /usr/local/apache/bin/httpd to start apache and you're gold.

smarlowe
02-14-2001, 01:31 PM
I just did this build on another box of mine, and realized I'd gotten one teensy little bit wrong. in the php configure, you need to have the pdflib give the path to pdflib, which by default it put into the /usr/local/lib path like so:

./configure --with-pdflib=/usr/local/lib

smarlowe
02-15-2001, 07:36 AM
OK, finally got it to work, and it seems there's an issue with order (--with-pdflib needs to be the first switch, or very near it) and you don't need a path if the libpdf.so in in your library path (i.e. a line entered in /etc/ld.so.conf for the path and ldconfig run)

With those two considerations, pdflib support built just fine.