Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
818 views
in Technique[技术] by (71.8m points)

terminal - PDF Lib install fail on linux server. Using pecl install pdflib

I'm attempting to install pdflib on my server and receiving the error:

configure: error: pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory. ERROR: /root/tmp/pear/pdflib/configure --with-pdflib=/usr/local' failed

I am entering the following in terminal:

pecl install pdflib

path to pdflib installation? :

/usr/local

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...