dongyinshua9996 2016-09-10 20:27
浏览 64
已采纳

如何将PDFlib添加到bitnami mamp堆栈

I want to use PDFlib to add an image to an existing pdf. I'm currently testing my site on Bitnami mampstack-5.6.19-0, but PDFlib is not installed with this stack.

I've tried following the instructions in this post and adapting them to a Mac environment, but now luck

I updated my local php's pdflib using macports so I can give pecl the path to pdflib.h

This is a printout of the error get when running 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$ 
  • 写回答

1条回答 默认 最新

  • doutouman6245 2016-09-22 08:46
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题