本文介绍了PDF Lib安装在Linux服务器上失败.使用pecl install pdflib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器上安装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

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安装pdflib

pecl install pdflib

path to pdflib installation? :

/usr/local

/usr/local

推荐答案

我通过以下方式解决了问题:下载最新的 http://www.pdflib.com /binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz

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

解压缩它

# tar xzf PDFlib-Lite-7.0.5p3.tar.gz
# cd PDFlib-Lite-7.0.5p3

查看是否包含pdflib.h

See, if and where it contains pdflib.h

# find . -name 'pdflib.h'
./PDFlib-Lite-7.0.5p3/libs/pdflib/pdflib.h

通过pecl安装

# pecl install pdflib

如果要求输入路径,请输入相同的完整路径/home/xxx/Downloads/pdf/PDFlib-Lite-7.0.5p3/libs/pdflib从安装消息中查看是否添加了文件pdf.so(在php扩展目录中,此目录名称可能有所不同,但文件pdf.so必须存在):

If it asks for path, enter the same full path/home/xxx/Downloads/pdf/PDFlib-Lite-7.0.5p3/libs/pdflibSee 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

更改pdf.ini

# nano /etc/php5/apache2/php.ini

最后添加

extension=pdf.so

(您可能也希望将其添加到命令行php conf/etc/php5/cli/php.ini中)

(You may want to add it in command line php conf /etc/php5/cli/php.ini too)

重新加载Apache

reload apache

# service apache2 reload

看看,如果出现此扩展名

See, if this extension appears

  • 对于Apache,如果有关PDFlib的新内容,请参见phpinfo()函数的输出PDFlib启用PDFlib支持PDFlib GmbH二进制版本7.0.5p3PECL版本3.0.0修订版$修订版:1.80.2.2 $

  • for Apache see output of phpinfo() function if there is something new regarding PDFlibPDFlibPDFlib Support enabledPDFlib GmbH Binary-Version 7.0.5p3PECL Version 3.0.0Revision $Revision: 1.80.2.2 $

用于命令行

在提示符下输入

# php -i |grep PDF
PDFlib
PDFlib Support => enabled
PDFlib GmbH Binary-Version => 7.0.5p3

这篇关于PDF Lib安装在Linux服务器上失败.使用pecl install pdflib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 18:34