繁体   English   中英

如何将PDFlib添加到Bitnami Mamp堆栈

[英]How to adding PDFlib to bitnami mamp stack

我想使用PDFlib将图像添加到现有的pdf中。 我目前正在Bitnami mampstack-5.6.19-0上测试我的网站,但是此堆栈未安装PDFlib。

我试着按照这个指令 ,并使其适应在Mac环境,但现在运气

我使用macports更新了本地php的pdflib,因此我可以给pecl到pdflib.h的路径

这是运行pecl install pdflib时获得的错误的打印输出

bash-3.2$ sudo pecl install pdflib
downloading pdflib-3.0.4.tgz ...
Starting to download pdflib-3.0.4.tgz (27,043 bytes).........done: 27,043 bytes
7 source files, building
WARNING: php_bin /Applications/mampstack-5.6.19-0/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
path to pdflib installation? : Downloads/pdflib/opt/local/include
building in /private/tmp/pear/temp/pear-build-rootzX8tkK/pdflib-3.0.4
running: /private/tmp/pear/temp/pdflib/configure --with-pdflib=Downloads/pdflib/opt/local/include
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
checking for PHP prefix... /Applications/mampstack-5.6.19-0/php
checking for PHP includes... -I/Applications/mampstack-5.6.19- 0/php/include/php -I/Applications/mampstack-5.6.19-0/php/include/php/main -I/Applications/mampstack-5.6.19-0/php/include/php/TSRM -I/Applications/mampstack-5.6.19-0/php/include/php/Zend -I/Applications/mampstack-5.6.19-0/php/include/php/ext -I/Applications/mampstack-5.6.19-0/php/include/php/ext/date/lib
checking for PHP extension directory... /Applications/mampstack-5.6.19-0/php/lib/php/extensions
checking for PHP installed headers prefix... /Applications/mampstack-5.6.19-0/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for PDFlib support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
configure: error: pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.
ERROR: `/private/tmp/pear/temp/pdflib/configure --with-pdflib=Downloads/pdflib/opt/local/include' failed
bash-3.2$ 

Bitnami开发人员在这里,

您可以按照以下步骤在MAMP堆栈上安装PDFlib

  • 下载PDFlib

$ cd /路径/到/您的/家庭/下载

$ 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

  • 建立它

$ ./configure $ sudo make $ sudo make install

  • 通过pecl安装

$ pecl安装pdflib

它将pdf.so添加到您的扩展文件夹中,因此您应检查将其添加到何处。 考虑到您的installdir,它应该是/Applications/mampstack-5.6.19-0/php/lib/php/extensions/pdf.so

  • 最后,您必须将此行添加到`/Applications/mampstack-5.6.19-0/php/etc/php.ini中:

扩展名= pdf.so

  • 并重新启动Apache和php-fpm:

/Applications/mampstack-5.6.19-0/ctlscript.sh重新启动apache

/Applications/mampstack-5.6.19-0/ctlscript.sh重新启动php-fpm

您可以执行以下命令来检查扩展是否已加载:

php -i | grep PDF

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM