Install PDFLib with PHP


Posted by Andrew McCombe on Thu Jul 9, 2009

To install the PDFLib functionality you need to do the following (on an Ubuntu box).

# cd /tmp
# wget http://www.pdflib.com/binaries/PDFlib/704p1/PDFlib-7.0.4p1-Linux.tar.gz.
# tar xvfz PDFlib-7.0.4p1-Linux.tar.gz

Then install PDFLib using pecl:

# sudo pecl install pdflib

This will ask for the path to PDFlib headers. Select ‘1’ and enter:

/tmp/PDFlib-7.0.4p1-Linux/bind/c

Then hit enter. It should then finish.
Finally, add the pdf module to the PHP configuration and restart apache:

# sudo echo "extension=libpdf_php.so" > /etc/php5/conf.d/libpdf.ini
# sudo /etc/init.d/apache2 restart

To check that it works, enter:

# php -i | grep "PDFlib GmbH"
PDFlib GmbH Version => 7.0.4p1