The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP, PDFs, and pdflib

Discussion in 'General Discussion' started by MZmuda, May 1, 2006.

  1. MZmuda

    MZmuda Active Member

    Joined:
    Oct 22, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Long Island, NY
    Can anyone tell me exactly what the WHM-->Software-->Apache Update / Option: PHP Module (Version 4.3.3) -->PDFlib does?

    I thought it installs the PDF functionality into PHP via the PDFlib lite module with

    '--with-pdflib'

    When I do a phpinfo command, I get the following in the "header":

    Configure Command
    './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-mcrypt' '--enable-magic-quotes' '--with-mysql=/usr' '--enable-discard-path' '--with-pdflib' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib'

    Registered PHP Streams
    php, http, ftp, compress.zlib

    I also get the following in the Configuration area:

    PDF:
    PDF Support enabled
    PDFlib GmbH Version 5.0.3
    Revision $Revision: 1.112.2.11 $


    This suggests to me that pdflib is installed and recognized by php, BUT...

    when I do a pdf_begin_document(), (as copied / pasted from the PHP.net PDF example area) I get the following error:

    Fatal error: Call to undefined function: pdf_begin_document() in ...

    So, 2 questions:
    1) How do I add PDF support into PHP
    2) Am I doing something wrong? Is PDF support installed, and something else is going awry?)

    Thanks in advance.

    - Mike Z
     
  2. cdick@ocis.net

    Joined:
    May 5, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Same problem here

    Hi there,
    Did you ever find a solution for this? I found the exact same thing, I was able to select PDFLib from the easyapache build in the PHP section. My phpinfo output now shows that PHP (4.4.2) is built "--with-pdflib" but I get the same Call to undefined function: pdf_begin_document() when I try to run the hello world example. Before recompiling Apache (with PHP having --with-pdflib), I was getting a different error:
    Call to undefined function: pdf_new()

    Thanks in advance for any advice or solutions.
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Take a peek at my previous reply.

    [edit]A timewarp played havoc there. The reply to which I refer is below not above this one.[/edit]
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Looks like you're using the PHP4 style function-oriented method (as opposed to the PHP5 object-oriented method).

    Have you followed the method on php.net precisely?

    Code:
     In PHP 4, first a PDF resource has to be retrieved with a function call like
    
    $p = PDF_new(). 
    If you're just using pdf_begin_document() without preparing things first, it's probably not going to work.

    Take a glance through the manual again. Copy and paste the entire example and run it to first get a feel for how it works.
     
Loading...

Share This Page