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/apachegz
]# tar -xvzf /root/gz/phpgz
]# 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.