MRKAVANA (mrkavana@gmail.com) - www.facebook.com/kavanathai

Aug 25, 2011

How to install PDFlib-Lite & PDFlib on a RedHat/CentOS server?


PDFlib is a free library used for generating and manipulating files in Portable Document Format (PDF). The primiary goal of PDFlib is to create dynamic PDF documents on a Web server OR similar systems and to allow a “save as PDF” capability.
The following steps will help you to install PDFlib-lite and PDFlib on a CentOS server OR even on a cPanel and Plesk servers. SSH to the server as user ‘root’:
1) Download the PDFlib-Lite package required for PDFlib installation in a temporary directory
# cd /usr/local/src
# wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5.tar.gz
2) Unpack the package and goto the PDFlib-Lite directory
# tar -zxf PDFlib-Lite-7-*
# cd PDFlib-Lite-7.0*
3) Now, configure PDFlib-Lite
# ./configure --prefix=/usr/local
4) Create the installation files and install PDFlib-Lite
# make
# make install
5) Once PDFlib-Lite is installed, download ‘PDFlib’ using pecl.
# pecl download pdflib
6) Unpack the package and goto the PDFlib-Lite directory
# tar xvzf pdflib-*.tgz
# cd pdflib-*
7) Create configuration files
# phpize
8 ) Now, configure PDFlib
# ./configure
9) Create the installation files and install PDFlib
# make
# make install
A pdf.so file will be created in the PHPs extension directory which you can locate using the following command. If the file is not created there, copy it from the current location to the extension directory.
# php -i | grep extension_dir
The final step is to add the PDFLib extension in the php.ini file and restart the Web Server.
extension="pdf.so"
Note: Using the above instructions, PDFlib can be installed on the cPanel and Plesk servers as well. Though the location of extension_dir and php.ini are different, they can easily be located using the commands above.

No comments:

Post a Comment