View Full Version : PHP with PDFLIB?
23rd April 2004, 03:23 PM
Does anyone know of a Fedora-compliant binary RPM that includes PHP, MySQL and PDFlib (or PDFlib Lite)?
I need to get PDFLIB (or PDFLIB-Lite) compiled into my PHP-MYSQL installation on FC1. Looking at the PHPINFO() screen I get back from my current set-up, i'm trying to replicate the exact config options - I just want the same as I've got, but at the current PHP 4.3.6 release from Zend and with this library enabled.
This looks to be a major undertaking, necessitating building a lot of the options (and MySQL, OpenSSL, etc) up from their sources before initiating the same build.
Is there an easier way? :-)
26th April 2004, 03:38 PM
Zend include PDFLIB in their PHP binaries for Windows users but do no binary distribution for Linux at all (not just Fedora). Does anyone know any RPMs available that contain PHP, MySQL, PDFLib (plus Zend Studio)?
29th April 2004, 02:24 AM
Just compile it... takes but a few minutes.
30th April 2004, 03:27 PM
Just to try to be safe, I try to follow the same ./configure command used when the 4.3.4 version of PHP was build for Fedora, just adding a --with-pdflib line as well (i've already built pdflib lite support files from it's sources).
FWIW, I am ex experienced programmer, albeit i'm still finding my way around Unix derivatives (I used to write device drivers on VAX/VMS a few years back) and what goes where.
Virtually the final line of the configure command references --with-apxs2=/usr/sbin/apxs - and this is nowhere to be seen on my system. Missing it out gets a version of PHP configured, which I can then make and make install (abeit with security warnings about cgi implementations exposing a vulnerability of some kind).
The problem then is that obviously, Fedora stores things in different places than Zend put them - or the reworked command is building PHP as a CGI when Apache is expecting something suporting it as a DSO (it's not yet obvious to me how the bits are distributed on a typical system) - so restarting Apache with my attempted 4.3.6 release just build still gives me 4.3.4 in phpinfo().
None of the documentation I have is that helpful in trying to spell out exactly what I have to do to straighten things out. My PHP book has the guy building against Apache 1.3 from sources, which I don't want to do - I just want the latest version of PHP configured as was, but with PDFlib in there too.
If anyone can give me any pointers (to a fix or to some bedtime reading), it'd be really appreciated.
30th April 2004, 08:43 PM
./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-pdflib --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex=system --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --without-oci8 --with-pear=/usr/share/pear --with-imap=shared --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=shared,/usr --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mcal --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-apxs2=/usr/sbin/apxs
This gives up with the --with-apxs2=/usr/sbin/apxs line - no file with this name anywhere on my system, and if it was there, it looks like it should have come as part of the Apache generation. So, just as an academic exercise, cut this line out.
Then it gives up the ghost on bz2. Cut that out, then can't find rrfc822.h as part of imap support. Knowing this is fairly deprecated these days (this is the old server side image map), cut that out the two references to imap stuff...
Now it can't find the MySQL header files under /usr
So, i'm trying to follow the same build procedure used to generate my existing set up and i'm increasingly just blowing bigger holes in it - without getting as far as a successful build.
It feels like I have a big sweep of collecting sources all over the place to get this thing in a state where I have pdflib support in PHP... without breaking something else in doing so. Far from "just a few minutes" so far :-}
Am I doing something fundamentally wrong? Or does anyone know a nice binary RPM anywhere incorporating PHP 4.3.6, MySQL and PDFlib (or PDlib Lite)?
ps: I've been given pointers to a PDF class library, but I have some old PDFlib code to build on!
30th April 2004, 09:34 PM
You're compiling a great deal of things that likely wil never be needed by you.
Add what you need, nothing more.
Assuming you just need MySQL and the PDFLib..
./configure --with-apxs2=/usr/sbin/apxs --with-mysql
Append the PDFlib arguments, and you're set. Of course, replace the path to apxs2...
(Note that the above configure arguments will successfully configure php to run with MySQL -- you don't need to specify any libraries, php has its own)
You didn't install the httpd-devel package, however... a rather essential item. It includes apxs. Install it, and then the path I provided for apxs above will be valid.
1st May 2004, 12:14 AM
...but i'm now just getting errors on the make after configure seems to flow through without problems, vis:
ext/ctype/ctype.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1
I'll try a minimal install in the morning. Think i'll have a clearer head then!
3rd May 2004, 02:09 PM
Doing a yum install httpd-devel, followed by a make clean, then rebuilding without ODBC, BZip2 and Postgres support did the trick. I have PHP 4.3.6 now running with PDFlib Lite support built in, and all my examples work now.
I greatly appreciate the help - thank you.
I'm now wondering whether or not I should dare try out all my code on PHP5 now! But i'll probably park that until I have my project site prototype up and running now.
4th November 2004, 01:47 PM
This may sound stupid(forgive my I'm a newb) but how can I "./configure --with-apxs2=/usr/sbin/apxs --with-mysql" aftter a yum install httpd-devel?
9th March 2006, 09:41 AM
I think you don't have to build anything, just use the official RPM of httpd, php...
Then install pdflib (could take the RPM on my depôt : http://remi.collet.free.fr/rpms/)
To install the PDF support in PHP use (need php-devel and pdflib-devel)
pear install pdflib
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.