Adding fdftk to php under debian

Since there is not an easy step by step howto for adding features to packages I decided to write a quick and dirty one myself. this is also for reference if I ever need it later. Read more to see what I did….

Debian Build from source:

– Download source packages
apt-get source *packagename*

– Change any config rules
vi *packagename directory*/debian/rules

– Download build dependencies
apt-get build-dep *packagename*

– Compile the package
apt-get -b source *packagename*

– Install it
dpkg -i *packagename*.deb

Adding fdf support to php5-5.2.0:

Download source directory:
apt-get source php5

Download fdftk:

Extract fdftk:
tar xzf FDFToolkitForUnix.tar.gz

Copy files to /usr/local/:
cp "FDFToolkitForUnix/Headers and Libraries/Headers/*" /usr/local/include
cp "FDFToolkitForUnix/Headers and Libraries/LINUX/*" /usr/local/lib

Edit rules file php5-5.2.0/debian/rules and add under COMMON_CONFIG –with-fdftk=/usr/local Make sure you put a \ after the last configure line before the fdftk line

--with-exec-dir=/usr/lib/php5/libexec \

Install the newly compiled deb files:
dpkg -i *.deb


6 thoughts on “Adding fdftk to php under debian

  1. Here are the steps I did:

    cd /usr/src
    apt-get build-dep php5
    apt-get source php5
    tar xzf FDFToolkitForUnix.tar.gz
    cp FDFToolkitForUnix/Headers\ and\ Libraries/Headers/* /usr/local/include/
    cp FDFToolkitForUnix/Headers\ and\ Libraries/LINUX/* /usr/local/lib/
    nano php5-5.2.6.dfsg.1/debian/rules
    **I changed lines 109 and 110 to
    –with-system-tzdata \
    apt-get -b source php5

    It compiled successfully. I tested this on Ubuntu-Server 9.04 _Jaunty Jackalope_ – Release i386 (20090421.1)

  2. Pingback: PHP setup using rpm

  3. Hello, I am trying to install php5 with fdftk support on a debian box(2.6.32-5-amd64).

    When I completed the following steps succefully, I created a test.php file with this line of code:

    $test = fdf_create();

    But, the browser displayed the error “Fatal error: Call to undefined function fdf_create()”

    Here are the steps I followed:

    $: cd /usr/src
    $: wget
    $: tar -xaf FDFToolkitForUnix.tar.gz
    $: cp FDFToolkitForUnix/Headers and Libraries/Headers/* /usr/local/include/
    $: cp FDFToolkitForUnix/Headers and Libraries/LINUX/* /usr/local/lib/
    $: apt-get source php5
    $: apt-get build-dep php5
    $: cd php5-5.3.3/debian

    Opened up the file rules in a text editor
    under the COMMON_CONFIG add this line
    Opened up file
    Edit this line:
    $mysqld > $datadir/run.log 2>&1 &
    With this line:
    $mysqld –user=root > $datadir/run.log 2>&1 &

    $: apt-get –b source php5
    $: dpkg –i .deb

    could it be the version of php5 I am using? or do you know of anything else that might help?

    Thank you!

    • I would make sure you have a \ at the end of the line before the –with-fdftk in the COMMON_CONFIG. Also you can test to see if fdf is installed correctly by outputting phpinfo() it will have fdf listed in the modules list.

      But I see you are using 5.3.3. It looks like fdf has moved to a PECL extension based on this page:

      This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.3.0

      So you will have to install with the pecl command.

  4. Thank you Jeremy for responding. I actually found a class to do what I need to do and so I don’t need to use the fdf methods from php…thank you again!

Comments are closed.