PDF Lib install fail on linux server. Using pecl install pdflib
I got it solved this way:
Downloaded latest http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz
# cd /home/xxx/Downloads/
# wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz
Un-tar-gzip it
# tar xzf PDFlib-Lite-7.0.5p3.tar.gz
# cd PDFlib-Lite-7.0.5p3
See, if and where it contains pdflib.h
# find . -name 'pdflib.h'
./PDFlib-Lite-7.0.5p3/libs/pdflib/pdflib.h
Install via pecl
# pecl install pdflib
If it asks for path, enter the same full path
/home/xxx/Downloads/pdf/PDFlib-Lite-7.0.5p3/libs/pdflib
See from installation messages, if and where it added file pdf.so (in php extensions directory, this dir name may vary but file pdf.so has to exist):
# ls -la /usr/lib/php5/20090626
change pdf.ini
# nano /etc/php5/apache2/php.ini
adding at the end
extension=pdf.so
(You may want to add it in command line php conf /etc/php5/cli/php.ini too)
reload apache
# service apache2 reload
See, if this extension appears
for Apache see output of phpinfo() function if there is something new regarding PDFlib
PDFlib
PDFlib Support enabled
PDFlib GmbH Binary-Version 7.0.5p3
PECL Version 3.0.0
Revision $Revision: 1.80.2.2 $for command line
enter at prompt
# php -i |grep PDF
PDFlib
PDFlib Support => enabled
PDFlib GmbH Binary-Version => 7.0.5p3
Error installing PDFlib
EDIT:
As Chris said in the comments, it does indicate you do not have a c compiler installed.
sudo apt-get install g++
If it still doesn't work after installing g++, then try the below steps.
You may need to install the specific PHP PDFlib version downloaded directly from their site, then install via pecl.
http://www.pdflib.com/download/pdflib-family/pdflib-9/
Someone else resolved the problem this way, see the following post for full setup instructions:
PDF Lib install fail on linux server. Using pecl install pdflib
Installing pdf for php
First install pear
apt-get install php-pear
pecl install pdflib
The ask be: 'path to pdflib installation? : ' enter '/usr/local'
How to adding PDFlib to bitnami mamp stack
Bitnami developer here,
You can install PDFlib
on your MAMP Stack following the steps below:
- Download PDFlib
$ cd /path/to/your/home/Downloads
$ wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz
- Uncompress it
$ tar -xzf PDFlib-Lite-7.0.5p3.tar.gz
$ cd PDFlib-Lite-7.0.5p3
- Build it
$ ./configure
$ sudo make
$ sudo make install
- Install via pecl
$ pecl install pdflib
It will add pdf.so to your extensions folder, so you should check where it adds it. Taking into account your installdir, it should be /Applications/mampstack-5.6.19-0/php/lib/php/extensions/pdf.so
.
- Finally, you have to add this line to your `/Applications/mampstack-5.6.19-0/php/etc/php.ini:
extension=pdf.so
- And restart Apache and php-fpm:
/Applications/mampstack-5.6.19-0/ctlscript.sh restart apache
/Applications/mampstack-5.6.19-0/ctlscript.sh restart php-fpm
You can check that the extension is loaded executing this command:
php -i | grep PDF
php version in plesk - extension installing on wrong version
I would recommend to do the typical installations steps.
- download the current PDFlib package for your Linux (64-bit) PHP and unpack the archive on your server
- pick the correct PDFlib PHP DSO for your used PHP version (see bind/php/php-*)
- get the correct extension_dir path from your phpinfo() output.
- copy the PDFlib PHP DSO to the extension_dir
- determine the correct php.ini from the phpinfo() output
- add extension=php_pdflib.so to the php.ini
after a restart of your webserver, you should see a "PDFlib" section in the phpinfo() output.
Please see also the PDFlib in PHP Howto or PDFlib 9.1 Tutorial, chapter 2.9 "PHP Binding" for more detailed introduction how to install PDFlib.
Related Topics
How to Download the Torvalds Linux Kernel Master, (Re)Compile It, and Boot It with Qemu
Why Is Crond Failing to Run a Non-Root Crontab on Alpine Linux
How to Make a Bash Shell Script Interact with Another Command Line Program
Sed Help: Matching and Replacing a Literal "\N" (Not the Newline)
Check If a Program in a Specific Path Is Running
Using Named Pipes with Bash - Problem with Data Loss
Microsecond Accurate (Or Better) Process Timing in Linux
Linux Command Output as a Parameter of Another Command
How to Use Awk to Convert All the Lower-Case Letters into Upper-Case
What Does "|" Mean in a Terminal Command Line
How to Program for Linux's New 'Fanotify' File System Monitoring Feature
Accessing the Gpio (Of a Raspberry Pi) Without ''Sudo''
Linux Kernel - Add System Call Dynamically Through Module
Setup Cron Tab to Specific Time of During Weekdays
Linux Command to Delete All Files Except .Git Folder
/Usr/Bin/Perl: Bad Interpreter: Text File Busy