PDFlib support for PHP7.0 on Ubuntu 16.04

Date posted: 16-10-2017

Task: Enable PDF for PHP7.0

Based on your server architecture download PDFlib software from PDFlib site.

cd /usr/local/src

wget https://www.pdflib.com/binaries/PDFlib/911/PDFlib-9.1.1p3-Linux-x86_64-php.tar.gz

tar -xvf PDFlib-9.1.1p3-Linux-x86_64-php.tar.gz
cd PDFlib-9.1.1p3-Linux-x86_64-php/

Find PHP extension_dir

# php -ini | grep extension_dir
extension_dir => /usr/lib/php/20151012 => /usr/lib/php/20151012

copy .so file to that directory
cp bind/php/php-700/php_pdflib.so /usr/lib/php/20151012/

Add below entry in your php.ini file

vi /etc/php/7.0/apache2/php.ini
extension=php_pdflib.so

Verify apache syntax and restart if OK

# apachectl -t
Syntax OK

/etc/init.d/apache2 graceful

You can verify it from phpinfo – http://SERVERIP/info.php

1 thought on “PDFlib support for PHP7.0 on Ubuntu 16.04”

Leave a Reply