Click to See Complete Forum and Search --> : can't install libpdf


jubripley
07-25-2003, 05:28 PM
PLEASE HELP ME!!!

I've checked other pdflib installation posts, but couldn't find the answer to my problem...

System = debian linux. php 4.1.2, apache 1.3.26.

I need to use pdflib.

I'm kind of confused about whether I need to recompile php using the --with-pdflib config, or add "extension=pdflib_php.so" to my php.ini (or both). I'm having trouble with both.

I went to pdflib.com, got PDFlib-5.0.1-Linux.tar.gz, untarred it.
I then copied php4.1.2/libpdf_php.so to /usr/local/lib (I didn't see a makefile or anything, just the so file). I then added /usr/local/lib to my ld.so.conf file and ran ldconfig.

I then ran this configure command:
rm config.cache; './configure' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--disable-debug' '--enable-memory-limit' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db2' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--with-xml=/usr' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--disable-static' '--with-layout=GNU' '--with-dom=shared,/usr' '--with-zlib-dir=/usr' '--with-jpeg-dir=shared,/usr' '--with-png-dir=shared,/usr' '--with-mcal=shared,/usr' '--with-mhash=shared,/usr' '--with-mm' '--with-mysql=shared,/usr' '--with-recode=shared,/usr' '--enable-xslt' '--with-xslt-sablot=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-ttf=shared,/usr' '--with-t1lib=shared,/usr' '--with-pdflib'

configure gives me this error:
configure: error: pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg

(I know I have libtiff and libjpeg)

So, failing that, I added
extension=pdflib_php.so
to my php.ini. When I restart apache I get this:

PHP Warning: pdf: Unable to initialize module
Module compiled with debug=0, thread-safety=0 module API=20020429
PHP compiled with debug=0, thread-safety=0 module API=20010901

urg.

Can anyone help me get this working?
I would very much appreciate it.

thanks

tsinka
07-26-2003, 02:32 AM
Hi,

several problems:

1) if you use php-4.3.2 you might have to recompile the pdf module but the "biggest" problem is that the binary distribution of pdflib is for evaluation purposes only. It will print a demo stamp on every generated PDF file.

The error message you get tells you that that version of the php module is not compatible with the php version you use.

If you download the PDFlib Lite which might be sufficient for your needs and recompile it from source there will be no demo stamps.

I compiled PDFlib Lite and php several times without any problems, here's a short description of how I did it. I must say that I did that on SuSE Linux but it should be nearly the same on Debian.

1)
download PDFlite source at

http://www.pdflib.com/products/download-source.html

2)
unpack it and run configure, e.g. ./configure --prefix=/usr/local

No other arguments *should* be neccessary, the configure script should find all it needs if the appropriate packages are installed.

Ignore the message about php at the end of the configure process, it's ok.

3)
run make

4)
run make test to test if everything is ok

5)
run make install

6)
make sure that /etc/ld.so.conf contains /usr/local/lib and run ldconfig

7)
remove the pdf php module from /usr/local/lib

8)
unzip the php source distribution (make sure that you have a clean php source directory)

9)
run configure with all the switches you used. configure should find the pdflib binaries in /usr/local/lib

10)
run make

11)
run make install

12)
pdflib support should be built into the libphp4.so module.

13)
make sure that php is activated in httpd.conf

14)
restart apache.

Post any errors if any occur.


Thomas

jubripley
07-26-2003, 02:40 AM
Thanks for your reply tsinka.
Unfortunately, PDFLite won't work for me unless it has pdf-editing. My understanding from looking at the pdflib website was that I needed PDFLIB5 + PDI (all $900 of it :( )

What my employer wants is to take a form in pdf and write values on the blank lines. I suppose I could generate the form + data from scratch every time, but my hope was to edit an existing pdf.

Any suggestions?

tsinka
07-26-2003, 02:47 AM
Ok,

there's a readme in the php directory of the binary pdflib distribution on how to rebuild the php module using the binary distribution. But I think the problem with the demo stamp will remain. The only way to get rid of that is to purchase a license.
I don't know another way.

Thomas