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
# 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:


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

# sudo echo "" > /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