View Full Version : PHP with PDFLIB?
IanWaring
2004-04-23, 08:23 AM CDT
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? :-)
IanWaring
2004-04-26, 08:38 AM CDT
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)?
ieatlint
2004-04-28, 07:24 PM CDT
Just compile it... takes but a few minutes.
IanWaring
2004-04-30, 08:27 AM CDT
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.
Ian W.
IanWaring
2004-04-30, 01:43 PM CDT
./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)?
Ian W.
ps: I've been given pointers to a PDF class library, but I have some old PDFlib code to build on!
ieatlint
2004-04-30, 02:34 PM CDT
You're compiling a great deal of things that likely wil never be needed by you.
./configure --help
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.
IanWaring
2004-04-30, 05:14 PM CDT
...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!
Ian W.
IanWaring
2004-05-03, 07:09 AM CDT
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.
Ian W.
Soulhunter
2004-11-04, 06:47 AM CST
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?
remi
2006-03-09, 02:41 AM CST
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
Cordialy
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.